[PATCH 1/2] NFS: call block plug around direct write

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

 



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

Signed-off-by: Peng Tao <tao.peng@xxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux USB Development]     [Linux Media Development]     [Video for Linux]     [Linux NILFS]     [Linux Audio Users]     [Yosemite Info]     [Linux SCSI]

  Powered by Linux