aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/objlayout
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/objlayout
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/objlayout')
-rw-r--r--fs/nfs/objlayout/objio_osd.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/nfs/objlayout/objio_osd.c b/fs/nfs/objlayout/objio_osd.c
index ea6d111b03e9..be731e6b7b9c 100644
--- a/fs/nfs/objlayout/objio_osd.c
+++ b/fs/nfs/objlayout/objio_osd.c
@@ -41,6 +41,7 @@
41#include <scsi/osd_ore.h> 41#include <scsi/osd_ore.h>
42 42
43#include "objlayout.h" 43#include "objlayout.h"
44#include "../internal.h"
44 45
45#define NFSDBG_FACILITY NFSDBG_PNFS_LD 46#define NFSDBG_FACILITY NFSDBG_PNFS_LD
46 47
@@ -606,8 +607,14 @@ static bool aligned_on_raid_stripe(u64 offset, struct ore_layout *layout,
606void objio_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req) 607void objio_init_write(struct nfs_pageio_descriptor *pgio, struct nfs_page *req)
607{ 608{
608 unsigned long stripe_end = 0; 609 unsigned long stripe_end = 0;
610 u64 wb_size;
609 611
610 pnfs_generic_pg_init_write(pgio, req); 612 if (pgio->pg_dreq == NULL)
613 wb_size = i_size_read(pgio->pg_inode) - req_offset(req);
614 else
615 wb_size = nfs_dreq_bytes_left(pgio->pg_dreq);
616
617 pnfs_generic_pg_init_write(pgio, req, wb_size);
611 if (unlikely(pgio->pg_lseg == NULL)) 618 if (unlikely(pgio->pg_lseg == NULL))
612 return; /* Not pNFS */ 619 return; /* Not pNFS */
613 620