diff options
author | Fred Isaman <iisaman@netapp.com> | 2011-03-23 13:27:51 +0000 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2011-03-23 15:29:03 -0400 |
commit | a861a1e1c398fe34701569fd8ac9225dfe0a9a7e (patch) | |
tree | fe28b8cfa4b8a6066ee6f2feeaa2b61e9bfaa0c0 /fs/nfs/pagelist.c | |
parent | 425eb736cd905181a4dd4dc8d66342a7c7ab2f27 (diff) | |
download | linux-a861a1e1c398fe34701569fd8ac9225dfe0a9a7e.tar.gz linux-a861a1e1c398fe34701569fd8ac9225dfe0a9a7e.tar.bz2 linux-a861a1e1c398fe34701569fd8ac9225dfe0a9a7e.zip |
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 'fs/nfs/pagelist.c')
-rw-r--r-- | fs/nfs/pagelist.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/nfs/pagelist.c b/fs/nfs/pagelist.c index fd85618149a1..87a593c2b055 100644 --- a/fs/nfs/pagelist.c +++ b/fs/nfs/pagelist.c @@ -398,6 +398,7 @@ int nfs_scan_list(struct nfs_inode *nfsi, pgoff_t idx_end; int found, i; int res; + struct list_head *list; res = 0; if (npages == 0) @@ -418,10 +419,10 @@ int nfs_scan_list(struct nfs_inode *nfsi, idx_start = req->wb_index + 1; if (nfs_set_page_tag_locked(req)) { kref_get(&req->wb_kref); - nfs_list_remove_request(req); radix_tree_tag_clear(&nfsi->nfs_page_tree, req->wb_index, tag); - nfs_list_add_request(req, dst); + list = pnfs_choose_commit_list(req, dst); + nfs_list_add_request(req, list); res++; if (res == INT_MAX) goto out; |