[pnfs] [PATCH 02/18] pnfs: add nfs_pageio_descriptor to pg_test

andros at umich.edu andros at umich.edu
Mon Jan 7 15:47:18 EST 2008


From: Andy Adamson <andros at umich.edu>

In preparation for the write I/O path, replace the boundary integer with
a struct nfs_pageio_descriptor pointer in the pg_test routine.

Signed-off by: Andy Adamson<andros at umich.edu>
---
 fs/nfs/nfs4filelayout.c   |    8 ++++----
 fs/nfs/pagelist.c         |    2 +-
 include/linux/nfs4_pnfs.h |    4 +++-
 include/linux/nfs_page.h  |    2 +-
 4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/nfs4filelayout.c b/fs/nfs/nfs4filelayout.c
index 73ba031..d23a0e4 100644
--- a/fs/nfs/nfs4filelayout.c
+++ b/fs/nfs/nfs4filelayout.c
@@ -632,16 +632,16 @@ filelayout_gather_across_stripes(struct pnfs_mount_type *mountid)
  * return 0 :  pref and req on different stripe.
  */
 int
-filelayout_pg_test(int boundary, struct nfs_page *prev, struct nfs_page *req)
+filelayout_pg_test(struct nfs_pageio_descriptor *pgio, struct nfs_page *prev, struct nfs_page *req)
 {
 	u32 p_stripe, r_stripe;
 
-	if (boundary == 0)
+	if (pgio->pg_boundary == 0)
 		return 1;
 	p_stripe = prev->wb_index << PAGE_CACHE_SHIFT;
-	do_div(p_stripe, boundary);
+	do_div(p_stripe, pgio->pg_boundary);
 	r_stripe = req->wb_index << PAGE_CACHE_SHIFT;
-	do_div(r_stripe, boundary);
+	do_div(r_stripe, pgio->pg_boundary);
 
 	return (p_stripe == r_stripe);
 }
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 491cb10..b49ace5 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -267,7 +267,7 @@ static int nfs_can_coalesce_requests(struct nfs_page *prev,
 	if (prev->wb_pgbase + prev->wb_bytes != PAGE_CACHE_SIZE)
 		return 0;
 #ifdef CONFIG_PNFS
-	if (pgio->pg_test && (pgio->pg_test(pgio->pg_boundary, prev, req) == 0))
+	if (pgio->pg_test && (pgio->pg_test(pgio, prev, req) == 0))
 		return 0;
 #endif /* CONFIG_PNFS */
 	return 1;
diff --git a/include/linux/nfs4_pnfs.h b/include/linux/nfs4_pnfs.h
index 529f522..7b2473d 100644
--- a/include/linux/nfs4_pnfs.h
+++ b/include/linux/nfs4_pnfs.h
@@ -14,6 +14,8 @@
 
 #if defined(CONFIG_PNFS)
 
+#include <linux/nfs_page.h>
+
 #define NFS4_PNFS_DEV_MAXCOUNT 16
 #define NFS4_PNFS_DEV_MAXSIZE 128
 
@@ -88,7 +90,7 @@ struct layoutdriver_policy_operations {
 	int (*gather_across_stripes) (struct pnfs_mount_type *mountid);
 
 	/* test for nfs page cache coalescing */
-	int (*pg_test)(int, struct nfs_page *, struct nfs_page *);
+	int (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
 
 	/* Retreive the block size of the file system.  If gather_across_stripes == 1,
 	 * then the file system will gather requests into the block size.
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index d957ab3..49a5de1 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -63,7 +63,7 @@ struct nfs_pageio_descriptor {
 	int			pg_error;
 #ifdef CONFIG_PNFS
 	int			pg_boundary;
-	int			(*pg_test)(int, struct nfs_page *, struct nfs_page *);
+	int			(*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
 #endif /* CONFIG_PNFS */
 };
 
-- 
1.5.0.2



More information about the pNFS mailing list