linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pnfsblock: init pg_bsize properly
@ 2011-08-13  1:04 Peng Tao
  2011-08-16 21:05 ` Boaz Harrosh
  0 siblings, 1 reply; 12+ messages in thread
From: Peng Tao @ 2011-08-13  1:04 UTC (permalink / raw)
  To: benny; +Cc: linux-nfs, Peng Tao

pg_bsize is server->wsize/rsize by default. We would want to use the lseg length.

Signed-off-by: Peng Tao <peng_tao@emc.com>
---
 fs/nfs/blocklayout/blocklayout.c |   20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/fs/nfs/blocklayout/blocklayout.c b/fs/nfs/blocklayout/blocklayout.c
index 36648e1..9143e61 100644
--- a/fs/nfs/blocklayout/blocklayout.c
+++ b/fs/nfs/blocklayout/blocklayout.c
@@ -919,14 +919,30 @@ bl_clear_layoutdriver(struct nfs_server *server)
 	return 0;
 }
 
+static void bl_pg_init_read(struct nfs_pageio_descriptor *pgio,
+			    struct nfs_page *req)
+{
+	pnfs_generic_pg_init_read(pgio, req);
+	if (pgio->pg_lseg)
+		pgio->pg_bsize = pgio->pg_lseg->pls_range.length;
+}
+
+static void bl_pg_init_write(struct nfs_pageio_descriptor *pgio,
+			     struct nfs_page *req)
+{
+	pnfs_generic_pg_init_write(pgio, req);
+	if (pgio->pg_lseg)
+		pgio->pg_bsize = pgio->pg_lseg->pls_range.length;
+}
+
 static const struct nfs_pageio_ops bl_pg_read_ops = {
-	.pg_init = pnfs_generic_pg_init_read,
+	.pg_init = bl_pg_init_read,
 	.pg_test = pnfs_generic_pg_test,
 	.pg_doio = pnfs_generic_pg_readpages,
 };
 
 static const struct nfs_pageio_ops bl_pg_write_ops = {
-	.pg_init = pnfs_generic_pg_init_write,
+	.pg_init = bl_pg_init_write,
 	.pg_test = pnfs_generic_pg_test,
 	.pg_doio = pnfs_generic_pg_writepages,
 };
-- 
1.7.1.262.g5ef3d


^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-08-26  0:17 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-13  1:04 [PATCH] pnfsblock: init pg_bsize properly Peng Tao
2011-08-16 21:05 ` Boaz Harrosh
2011-08-17  7:15   ` Benny Halevy
2011-08-17  9:35     ` Peng Tao
2011-08-17 16:27       ` Benny Halevy
2011-08-18 14:34         ` Peng Tao
2011-08-22 23:52       ` Boaz Harrosh
2011-08-23  0:00         ` Myklebust, Trond
2011-08-23 15:01           ` Peng Tao
2011-08-23 21:19             ` Boaz Harrosh
2011-08-25 20:15               ` Jim Rees
2011-08-26  0:16                 ` Boaz Harrosh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).