diff options
author | Trond Myklebust <trond.myklebust@primarydata.com> | 2014-07-10 14:07:26 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2014-07-10 15:05:26 -0400 |
commit | de18643dce70e0d7c3dbccb5d2c8f17f04bc24a6 (patch) | |
tree | b569dea6b6922cf46cb2d124ca620a9c1e048206 /fs/nfsd/state.h | |
parent | 1d31a2531ae91f8a89c0fffa883ef922c0dbb74d (diff) |
nfsd: Add locking to the nfs4_file->fi_fds[] array
Preparation for removal of the client_mutex, which currently protects
this array. While we don't actually need the find_*_file_locked variants
just yet, a later patch will. So go ahead and add them now to reduce
future churn in this code.
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/state.h')
-rw-r--r-- | fs/nfsd/state.h | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 04737b3ed363..9f1159d5de56 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -398,32 +398,6 @@ struct nfs4_file { bool fi_had_conflict; }; -/* XXX: for first cut may fall back on returning file that doesn't work - * at all? */ -static inline struct file *find_writeable_file(struct nfs4_file *f) -{ - if (f->fi_fds[O_WRONLY]) - return f->fi_fds[O_WRONLY]; - return f->fi_fds[O_RDWR]; -} - -static inline struct file *find_readable_file(struct nfs4_file *f) -{ - if (f->fi_fds[O_RDONLY]) - return f->fi_fds[O_RDONLY]; - return f->fi_fds[O_RDWR]; -} - -static inline struct file *find_any_file(struct nfs4_file *f) -{ - if (f->fi_fds[O_RDWR]) - return f->fi_fds[O_RDWR]; - else if (f->fi_fds[O_WRONLY]) - return f->fi_fds[O_WRONLY]; - else - return f->fi_fds[O_RDONLY]; -} - /* "ol" stands for "Open or Lock". Better suggestions welcome. */ struct nfs4_ol_stateid { struct nfs4_stid st_stid; /* must be first field */ |