linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] NFS: call block plug around direct write
@ 2012-05-15 15:38 Peng Tao
  2012-05-15 15:38 ` [PATCH 2/2] NFS: call block plug around direct read Peng Tao
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Peng Tao @ 2012-05-15 15:38 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, Peng Tao

We bypass generic_file_aio_write() but would want to call block plug.

Signed-off-by: Peng Tao <tao.peng@emc.com>
---
 fs/nfs/direct.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c
index a1b81dd..a485560 100644
--- a/fs/nfs/direct.c
+++ b/fs/nfs/direct.c
@@ -46,6 +46,7 @@
 #include <linux/kref.h>
 #include <linux/slab.h>
 #include <linux/task_io_accounting_ops.h>
+#include <linux/blkdev.h>
 
 #include <linux/nfs_fs.h>
 #include <linux/nfs_page.h>
@@ -922,6 +923,7 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
 	struct file *file = iocb->ki_filp;
 	struct address_space *mapping = file->f_mapping;
 	size_t count;
+	struct blk_plug plug;
 
 	count = iov_length(iov, nr_segs);
 	nfs_add_stats(mapping->host, NFSIOS_DIRECTWRITTENBYTES, count);
@@ -948,7 +950,9 @@ ssize_t nfs_file_direct_write(struct kiocb *iocb, const struct iovec *iov,
 
 	task_io_account_write(count);
 
+	blk_start_plug(&plug);
 	retval = nfs_direct_write(iocb, iov, nr_segs, pos, count);
+	blk_finish_plug(&plug);
 	if (retval > 0) {
 		struct inode *inode = mapping->host;
 
-- 
1.7.1.262.g5ef3d


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2012-05-16 17:13 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-15 15:38 [PATCH 1/2] NFS: call block plug around direct write Peng Tao
2012-05-15 15:38 ` [PATCH 2/2] NFS: call block plug around direct read Peng Tao
2012-05-16 17:12   ` Myklebust, Trond
2012-05-15 16:08 ` [PATCH 1/2] NFS: call block plug around direct write Christoph Hellwig
2012-05-15 16:23   ` Boaz Harrosh
2012-05-16  0:35     ` Peng Tao
2012-05-16  7:43       ` Boaz Harrosh
2012-05-16 17:12 ` Myklebust, Trond

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).