diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-08-13 18:54:45 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-28 16:03:04 -0400 |
commit | 2a369153c82e0c83621b3e71d8f0c53394705bda (patch) | |
tree | bed0f7bfde6d8eac2b58bf0f7c452afb5f906b40 /fs/nfs/write.c | |
parent | b3c54de6f82d01637796bcc1f667a45f3b32e814 (diff) |
NFS: Clean up helper function nfs4_select_rw_stateid()
We want to be able to pass on the information that the page was not
dirtied under a lock. Instead of adding a flag parameter, do this
by passing a pointer to a 'struct nfs_lock_owner' that may be NULL.
Also reuse this structure in struct nfs_lock_context to carry the
fl_owner_t and pid_t.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs/write.c')
-rw-r--r-- | fs/nfs/write.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fs/nfs/write.c b/fs/nfs/write.c index e3b55372726c..e1b5fe4d873a 100644 --- a/fs/nfs/write.c +++ b/fs/nfs/write.c | |||
@@ -846,6 +846,7 @@ static int nfs_writepage_setup(struct nfs_open_context *ctx, struct page *page, | |||
846 | int nfs_flush_incompatible(struct file *file, struct page *page) | 846 | int nfs_flush_incompatible(struct file *file, struct page *page) |
847 | { | 847 | { |
848 | struct nfs_open_context *ctx = nfs_file_open_context(file); | 848 | struct nfs_open_context *ctx = nfs_file_open_context(file); |
849 | struct nfs_lock_context *l_ctx; | ||
849 | struct nfs_page *req; | 850 | struct nfs_page *req; |
850 | int do_flush, status; | 851 | int do_flush, status; |
851 | /* | 852 | /* |
@@ -860,9 +861,12 @@ int nfs_flush_incompatible(struct file *file, struct page *page) | |||
860 | req = nfs_page_find_request(page); | 861 | req = nfs_page_find_request(page); |
861 | if (req == NULL) | 862 | if (req == NULL) |
862 | return 0; | 863 | return 0; |
863 | do_flush = req->wb_page != page || req->wb_context != ctx || | 864 | l_ctx = req->wb_lock_context; |
864 | req->wb_lock_context->lockowner != current->files || | 865 | do_flush = req->wb_page != page || req->wb_context != ctx; |
865 | req->wb_lock_context->pid != current->tgid; | 866 | if (l_ctx) { |
867 | do_flush |= l_ctx->lockowner.l_owner != current->files | ||
868 | || l_ctx->lockowner.l_pid != current->tgid; | ||
869 | } | ||
866 | nfs_release_request(req); | 870 | nfs_release_request(req); |
867 | if (!do_flush) | 871 | if (!do_flush) |
868 | return 0; | 872 | return 0; |