diff options
author | Peng Tao <bergwolf@gmail.com> | 2012-09-25 14:55:57 +0800 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-10-08 19:32:22 -0400 |
commit | 6296556f0b31eaff29f2a3aee2c17b7eae895b98 (patch) | |
tree | 19f39cac9cff045e8c753ab8908deadc1c9c6bab /fs/nfs/direct.c | |
parent | 35754bc00e94e598c432ad02f7a3d3063c4402e3 (diff) |
NFS41: send real write size in layoutget
For buffer write, block layout client scan inode mapping to find
next hole and use offset-to-hole as layoutget length. Object
layout client uses offset-to-isize as layoutget length.
For direct write, both block layout and object layout use dreq->bytes_left.
Signed-off-by: Peng Tao <tao.peng@emc.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/direct.c')
-rw-r--r-- | fs/nfs/direct.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/nfs/direct.c b/fs/nfs/direct.c index 4be8673ee18..cae26cbd59e 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/module.h> #include <linux/nfs_fs.h> #include <linux/nfs_page.h> @@ -191,6 +192,12 @@ static void nfs_direct_req_release(struct nfs_direct_req *dreq) kref_put(&dreq->kref, nfs_direct_req_free); } +ssize_t nfs_dreq_bytes_left(struct nfs_direct_req *dreq) +{ + return dreq->bytes_left; +} +EXPORT_SYMBOL_GPL(nfs_dreq_bytes_left); + /* * Collects and returns the final error value/byte-count. */ |