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

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

 



On Tue, 2012-05-15 at 23:38 +0800, Peng Tao wrote:
> 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;
>  

big NACK... This does not belong in generic NFS code: it is 100% block
specific, and needs to go in the pNFS blocks code.

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@xxxxxxxxxx
www.netapp.com

��.n��������+%������w��{.n�����{��w���jg��������ݢj����G�������j:+v���w�m������w�������h�����٥



[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