summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorChuck Lever <cel@citi.umich.edu>2002-10-06 19:35:08 -0700
committerLinus Torvalds <torvalds@home.transmeta.com>2002-10-06 19:35:08 -0700
commiteb582eba8825800488a47798e2b4b3f11a9533d9 (patch)
treebef3dceb61818a7f2c5d8969a8195103e8e6d63f /include/linux
parent3a453bd45ad56f395eabc85b07605ca1b9841b90 (diff)
[PATCH] remove NFS client internal dependence on page->index
This makes the NFS client copy the page->index field into its read and write request structures (struct nfs_page) when setting up I/O on a page. this makes it possible for NFS direct I/O support to reuse existing NFS client subroutines, and helps eventually allow NFS I/O to and from anonymous pages. it is a prerequisite for NFS direct I/O support.
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/nfs_fs.h8
-rw-r--r--include/linux/nfs_page.h3
2 files changed, 7 insertions, 4 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index c77fa88af5db..582c7aa90344 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -25,6 +25,7 @@
#include <linux/nfs.h>
#include <linux/nfs2.h>
#include <linux/nfs3.h>
+#include <linux/nfs_page.h>
#include <linux/nfs_xdr.h>
/*
@@ -243,9 +244,9 @@ loff_t page_offset(struct page *page)
}
static inline
-unsigned long page_index(struct page *page)
+loff_t req_offset(struct nfs_page *req)
{
- return page->index;
+ return ((loff_t)req->wb_index) << PAGE_CACHE_SHIFT;
}
/*
@@ -360,7 +361,8 @@ nfs_wb_all(struct inode *inode)
static inline int
nfs_wb_page(struct inode *inode, struct page* page)
{
- int error = nfs_sync_file(inode, 0, page_index(page), 1, FLUSH_WAIT | FLUSH_STABLE);
+ int error = nfs_sync_file(inode, 0, page->index, 1,
+ FLUSH_WAIT | FLUSH_STABLE);
return (error < 0) ? error : 0;
}
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 6bc44a6b1cb7..9fc362b75850 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -33,7 +33,8 @@ struct nfs_page {
struct page *wb_page; /* page to read in/write out */
wait_queue_head_t wb_wait; /* wait queue */
unsigned long wb_timeout; /* when to read/write/commit */
- unsigned int wb_offset, /* Offset of read/write */
+ unsigned long wb_index; /* Offset within mapping */
+ unsigned int wb_offset, /* Offset within page */
wb_bytes, /* Length of request */
wb_count; /* reference count */
unsigned long wb_flags;