From: Michael Moy <michael@moysys.com>
To: axboe@kernel.dk, hch@lst.de, linux-nvme@lists.infradead.org,
linux-block@vger.kernel.org
Subject: [PATCH v2] fs: pass the write life time hint to the mapped filesystem
Date: Mon, 18 Sep 2017 09:45:57 -0600 [thread overview]
Message-ID: <2f7829a5-d47b-e6a0-cc10-8b534e9772ab@moysys.com> (raw)
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@encoresemi.com>
---
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
next reply other threads:[~2017-09-18 15:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-18 15:45 Michael Moy [this message]
2017-09-18 15:49 ` [PATCH v2] fs: pass the write life time hint to the mapped filesystem Christoph Hellwig
2017-09-18 20:06 ` Michael Moy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2f7829a5-d47b-e6a0-cc10-8b534e9772ab@moysys.com \
--to=michael@moysys.com \
--cc=axboe@kernel.dk \
--cc=hch@lst.de \
--cc=linux-block@vger.kernel.org \
--cc=linux-nvme@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox