[PATCH v2] fs: pass the write life time hint to the mapped filesystem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The write hint needs to be copied to the mapped filesystem
so it can be passed down to the nvme device driver.

v2: fix tabs in the email

Signed-off-by: Michael Moy <michael.moy@xxxxxxxxxxxxxx>
---
  mm/filemap.c | 10 ++++++++++
  1 file changed, 10 insertions(+)

diff --git a/mm/filemap.c b/mm/filemap.c
index 870971e..f9849b8 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -3008,6 +3008,16 @@ ssize_t generic_perform_write(struct file *file,
  			break;
  		}

+		/*
+		 * Copy a write hint to the mapped filesystem.
+		 *
+		 * Use the File hint first, inode next.
+		 */
+		if (file->f_write_hint)
+			mapping->host->i_write_hint = file->f_write_hint;
+		else if (file->f_inode->i_write_hint)
+			mapping->host->i_write_hint = file->f_inode->i_write_hint;
+
  		status = a_ops->write_begin(file, mapping, pos, bytes, flags,
  						&page, &fsdata);
  		if (unlikely(status < 0))
--
1.8.3.1




[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux