aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-15 17:16:40 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2012-03-17 11:09:33 -0400
commit8dd3775889345850ecddd689b5c200cdd91bd8c9 (patch)
treeea697cfcac3f3a927e90d0048e9ed76b5a3ea8e5 /include
parent95a13f7b33be87d85d8e6652126a3f4d64d164db (diff)
NFSv4.1: Clean ups and bugfixes for the pNFS read/writeback/commit code
Move more pnfs-isms out of the generic commit code. Bugfixes: - filelayout_scan_commit_lists doesn't need to get/put the lseg. In fact since it is run under the inode->i_lock, the lseg_put() can deadlock. - Ensure that we distinguish between what needs to be done for commit-to-data server and what needs to be done for commit-to-MDS using the new flag PG_COMMIT_TO_DS. Otherwise we may end up calling put_lseg() on a bucket for a struct nfs_page that got written through the MDS. - Fix a case where we were using list_del() on an nfs_page->wb_list instead of list_del_init(). - filelayout_initiate_commit needs to call filelayout_commit_release on error instead of the mds_ops->rpc_release(). Otherwise it won't clear the commit lock. Cleanups: - Let the files layout manage the commit lists for the pNFS case. Don't expose stuff like pnfs_choose_commit_list, and the fact that the commit buckets hold references to the layout segment in common code. - Cast out the put_lseg() calls for the struct nfs_read/write_data->lseg into the pNFS layer from whence they came. - Let the pNFS layer manage the NFS_INO_PNFS_COMMIT bit. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com> Cc: Fred Isaman <iisaman@netapp.com>
Diffstat (limited to 'include')
-rw-r--r--include/linux/nfs_page.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 50856e9c1e5f..eac30d6bec17 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -28,6 +28,7 @@ enum {
28 PG_NEED_COMMIT, 28 PG_NEED_COMMIT,
29 PG_NEED_RESCHED, 29 PG_NEED_RESCHED,
30 PG_PARTIAL_READ_FAILED, 30 PG_PARTIAL_READ_FAILED,
31 PG_COMMIT_TO_DS,
31}; 32};
32 33
33struct nfs_inode; 34struct nfs_inode;
@@ -104,6 +105,16 @@ nfs_lock_request_dontget(struct nfs_page *req)
104 return !test_and_set_bit(PG_BUSY, &req->wb_flags); 105 return !test_and_set_bit(PG_BUSY, &req->wb_flags);
105} 106}
106 107
108static inline int
109nfs_lock_request(struct nfs_page *req)
110{
111 if (test_and_set_bit(PG_BUSY, &req->wb_flags))
112 return 0;
113 kref_get(&req->wb_kref);
114 return 1;
115}
116
117
107/** 118/**
108 * nfs_list_add_request - Insert a request into a list 119 * nfs_list_add_request - Insert a request into a list
109 * @req: request 120 * @req: request