From: Peng Tao <bergwolf@gmail.com>
To: benny@tonian.com
Cc: linux-nfs@vger.kernel.org, Peng Tao <peng_tao@emc.com>
Subject: [PATCH] pnfsblock: init pg_bsize properly
Date: Fri, 12 Aug 2011 18:04:10 -0700 [thread overview]
Message-ID: <1313197450-4595-1-git-send-email-bergwolf@gmail.com> (raw)
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
next reply other threads:[~2011-08-16 13:48 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-13 1:04 Peng Tao [this message]
2011-08-16 21:05 ` [PATCH] pnfsblock: init pg_bsize properly 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1313197450-4595-1-git-send-email-bergwolf@gmail.com \
--to=bergwolf@gmail.com \
--cc=benny@tonian.com \
--cc=linux-nfs@vger.kernel.org \
--cc=peng_tao@emc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).