[pnfs] [PATCH 21/28] pnfs: propagate fsdata into nfs_create_request

Fred Isaman iisaman at citi.umich.edu
Tue Mar 11 15:32:02 EDT 2008


The block driver needs this to pass information from nfs_write_begin
into nfs_create_request.

Signed-off-by: Fred Isaman <iisaman at citi.umich.edu>
---
 fs/nfs/file.c            |    2 +-
 fs/nfs/pagelist.c        |    2 +-
 fs/nfs/read.c            |    4 ++--
 fs/nfs/write.c           |   17 ++++++++++-------
 include/linux/nfs_fs.h   |    3 ++-
 include/linux/nfs_page.h |    3 ++-
 6 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/fs/nfs/file.c b/fs/nfs/file.c
index e870982..a7c37e4 100644
--- a/fs/nfs/file.c
+++ b/fs/nfs/file.c
@@ -376,7 +376,7 @@ static int nfs_write_end(struct file *file, struct address_space *mapping,
 	int status;
 
 	lock_kernel();
-	status = nfs_updatepage(file, page, offset, copied);
+	status = nfs_updatepage(file, page, offset, copied, fsdata);
 	unlock_kernel();
 
 	unlock_page(page);
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c
index 15a66ab..624083e 100644
--- a/fs/nfs/pagelist.c
+++ b/fs/nfs/pagelist.c
@@ -59,7 +59,7 @@ nfs_page_free(struct nfs_page *p)
 struct nfs_page *
 nfs_create_request(struct nfs_open_context *ctx, struct inode *inode,
 		   struct page *page,
-		   unsigned int offset, unsigned int count)
+		   unsigned int offset, unsigned int count, void *fsdata)
 {
 	struct nfs_server *server = NFS_SERVER(inode);
 	struct nfs_page		*req;
diff --git a/fs/nfs/read.c b/fs/nfs/read.c
index 1548531..bf92068 100644
--- a/fs/nfs/read.c
+++ b/fs/nfs/read.c
@@ -130,7 +130,7 @@ static int nfs_readpage_async(struct nfs_open_context *ctx, struct inode *inode,
 	len = nfs_page_length(page);
 	if (len == 0)
 		return nfs_return_empty_page(page);
-	new = nfs_create_request(ctx, inode, page, 0, len);
+	new = nfs_create_request(ctx, inode, page, 0, len, NULL);
 	if (IS_ERR(new)) {
 		unlock_page(page);
 		return PTR_ERR(new);
@@ -596,7 +596,7 @@ readpage_async_filler(void *data, struct page *page)
 	if (len == 0)
 		return nfs_return_empty_page(page);
 
-	new = nfs_create_request(desc->ctx, inode, page, 0, len);
+	new = nfs_create_request(desc->ctx, inode, page, 0, len, NULL);
 	if (IS_ERR(new))
 		goto out_error;
 
diff --git a/fs/nfs/write.c b/fs/nfs/write.c
index 9fb00fc..622da20 100644
--- a/fs/nfs/write.c
+++ b/fs/nfs/write.c
@@ -41,7 +41,8 @@
  */
 static struct nfs_page * nfs_update_request(struct nfs_open_context*,
 					    struct page *,
-					    unsigned int, unsigned int);
+					    unsigned int, unsigned int,
+					    void *);
 static void nfs_pageio_init_write(struct nfs_pageio_descriptor *desc,
 				  struct inode *inode, int ioflags);
 static const struct rpc_call_ops nfs_write_partial_ops;
@@ -187,13 +188,13 @@ static void nfs_mark_uptodate(struct page *page, unsigned int base, unsigned int
 }
 
 static int nfs_writepage_setup(struct nfs_open_context *ctx, struct page *page,
-		unsigned int offset, unsigned int count)
+			unsigned int offset, unsigned int count, void *fsdata)
 {
 	struct nfs_page	*req;
 	int ret;
 
 	for (;;) {
-		req = nfs_update_request(ctx, page, offset, count);
+		req = nfs_update_request(ctx, page, offset, count, fsdata);
 		if (!IS_ERR(req))
 			break;
 		ret = PTR_ERR(req);
@@ -589,7 +590,8 @@ static inline int nfs_scan_commit(struct inode *inode, struct list_head *dst, pg
  * Note: Should always be called with the Page Lock held!
  */
 static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
-		struct page *page, unsigned int offset, unsigned int bytes)
+				struct page *page, unsigned int offset,
+				unsigned int bytes, void *fsdata)
 {
 	struct address_space *mapping = page->mapping;
 	struct inode *inode = mapping->host;
@@ -639,7 +641,8 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context* ctx,
 		}
 		spin_unlock(&inode->i_lock);
 
-		new = nfs_create_request(ctx, inode, page, offset, bytes);
+		new = nfs_create_request(ctx, inode, page,
+					 offset, bytes, fsdata);
 		if (IS_ERR(new))
 			return new;
 	}
@@ -716,7 +719,7 @@ int nfs_flush_incompatible(struct file *file, struct page *page)
  * things with a page scheduled for an RPC call (e.g. invalidate it).
  */
 int nfs_updatepage(struct file *file, struct page *page,
-		unsigned int offset, unsigned int count)
+		   unsigned int offset, unsigned int count, void *fsdata)
 {
 	struct nfs_open_context *ctx = nfs_file_open_context(file);
 	struct inode	*inode = page->mapping->host;
@@ -738,7 +741,7 @@ int nfs_updatepage(struct file *file, struct page *page,
 		offset = 0;
 	}
 
-	status = nfs_writepage_setup(ctx, page, offset, count);
+	status = nfs_writepage_setup(ctx, page, offset, count, fsdata);
 	__set_page_dirty_nobuffers(page);
 
         dprintk("NFS:      nfs_updatepage returns %d (isize %Ld)\n",
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index a15219d..9417c67 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -473,7 +473,8 @@ extern int  nfs_congestion_kb;
 extern int  nfs_writepage(struct page *page, struct writeback_control *wbc);
 extern int  nfs_writepages(struct address_space *, struct writeback_control *);
 extern int  nfs_flush_incompatible(struct file *file, struct page *page);
-extern int  nfs_updatepage(struct file *, struct page *, unsigned int, unsigned int);
+extern int  nfs_updatepage(struct file *, struct page *, unsigned int,
+			   unsigned int, void *);
 extern int nfs_writeback_done(struct rpc_task *, struct nfs_write_data *);
 extern void nfs_writedata_release(void *);
 
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index be6719a..02a7c3d 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -78,7 +78,8 @@ extern	struct nfs_page *nfs_create_request(struct nfs_open_context *ctx,
 					    struct inode *inode,
 					    struct page *page,
 					    unsigned int offset,
-					    unsigned int count);
+					    unsigned int count,
+					    void *fsdata);
 extern	void nfs_clear_request(struct nfs_page *req);
 extern	void nfs_release_request(struct nfs_page *req);
 
-- 
1.5.3.3



More information about the pNFS mailing list