aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorFred Isaman <iisaman@netapp.com>2011-03-23 09:27:51 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2011-03-23 15:29:03 -0400
commita861a1e1c398fe34701569fd8ac9225dfe0a9a7e (patch)
treefe28b8cfa4b8a6066ee6f2feeaa2b61e9bfaa0c0 /include
parent425eb736cd905181a4dd4dc8d66342a7c7ab2f27 (diff)
NFSv4.1: add generic layer hooks for pnfs COMMIT
We create three major hooks for the pnfs code. pnfs_mark_request_commit() is called during writeback_done from nfs_mark_request_commit, which gives the driver an opportunity to claim it wants control over commiting a particular req. pnfs_choose_commit_list() is called from nfs_scan_list to choose which list a given req should be added to, based on where we intend to send it for COMMIT. It is up to the driver to have preallocated list headers for each destination it may need. pnfs_commit_list() is how the driver actually takes control, it is used instead of nfs_commit_list(). In order to pass information between the above functions, we create a union in nfs_page to hold a lseg (which is possible because the req is not on any list while in transition), and add some flags to indicate if we need to use the pnfs code. Signed-off-by: Fred Isaman <iisaman@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nfs_fs.h1
-rw-r--r--include/linux/nfs_page.h6
2 files changed, 6 insertions, 1 deletions
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 4179c368844b..eddda6ce7c42 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -226,6 +226,7 @@ struct nfs_inode {
226#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ 226#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */
227#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ 227#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */
228#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */ 228#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */
229#define NFS_INO_PNFS_COMMIT (8) /* use pnfs code for commit */
229 230
230static inline struct nfs_inode *NFS_I(const struct inode *inode) 231static inline struct nfs_inode *NFS_I(const struct inode *inode)
231{ 232{
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 92d54c81f51e..8023e4e25133 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -33,11 +33,15 @@ enum {
33 PG_CLEAN, 33 PG_CLEAN,
34 PG_NEED_COMMIT, 34 PG_NEED_COMMIT,
35 PG_NEED_RESCHED, 35 PG_NEED_RESCHED,
36 PG_PNFS_COMMIT,
36}; 37};
37 38
38struct nfs_inode; 39struct nfs_inode;
39struct nfs_page { 40struct nfs_page {
40 struct list_head wb_list; /* Defines state of page: */ 41 union {
42 struct list_head wb_list; /* Defines state of page: */
43 struct pnfs_layout_segment *wb_commit_lseg; /* Used when PG_PNFS_COMMIT set */
44 };
41 struct page *wb_page; /* page to read in/write out */ 45 struct page *wb_page; /* page to read in/write out */
42 struct nfs_open_context *wb_context; /* File state context info */ 46 struct nfs_open_context *wb_context; /* File state context info */
43 struct nfs_lock_context *wb_lock_context; /* lock context info */ 47 struct nfs_lock_context *wb_lock_context; /* lock context info */