aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/pnfs.c
diff options
context:
space:
mode:
authorPeng Tao <bergwolf@gmail.com>2012-09-25 02:55:57 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-10-08 19:32:22 -0400
commit6296556f0b31eaff29f2a3aee2c17b7eae895b98 (patch)
tree19f39cac9cff045e8c753ab8908deadc1c9c6bab /fs/nfs/pnfs.c
parent35754bc00e94e598c432ad02f7a3d3063c4402e3 (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/pnfs.c')
-rw-r--r--fs/nfs/pnfs.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c
index bd9769296e4..9a2bcce4528 100644
--- a/fs/nfs/pnfs.c
+++ b/fs/nfs/pnfs.c
@@ -1240,7 +1240,8 @@ pnfs_generic_pg_init_read(struct nfs_pageio_descriptor *pgio, struct nfs_page *r
1240EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_read); 1240EXPORT_SYMBOL_GPL(pnfs_generic_pg_init_read);
1241 1241
1242void 1242void
1243pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req) 1243pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio,
1244 struct nfs_page *req, u64 wb_size)
1244{ 1245{
1245 BUG_ON(pgio->pg_lseg != NULL); 1246 BUG_ON(pgio->pg_lseg != NULL);
1246 1247
@@ -1248,10 +1249,11 @@ pnfs_generic_pg_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *
1248 nfs_pageio_reset_write_mds(pgio); 1249 nfs_pageio_reset_write_mds(pgio);
1249 return; 1250 return;
1250 } 1251 }
1252
1251 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode, 1253 pgio->pg_lseg = pnfs_update_layout(pgio->pg_inode,
1252 req->wb_context, 1254 req->wb_context,
1253 req_offset(req), 1255 req_offset(req),
1254 req->wb_bytes, 1256 wb_size,
1255 IOMODE_RW, 1257 IOMODE_RW,
1256 GFP_NOFS); 1258 GFP_NOFS);
1257 /* If no lseg, fall back to write through mds */ 1259 /* If no lseg, fall back to write through mds */