diff options
author | Christoph Hellwig <hch@lst.de> | 2014-08-14 02:50:16 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2015-02-02 12:09:41 -0500 |
commit | e6ba76e1944613f16dddcba4b5836954ed3981f3 (patch) | |
tree | bcf3851e4e91127e2722aa631225dab48680c28a /fs/nfsd | |
parent | cd61c522318f2c30ce731bfdb14e7c34203e3d7c (diff) |
nfsd: make find/get/put file available outside nfs4state.c
Signed-off-by: Christoph Hellwig <hch@lst.de>
Diffstat (limited to 'fs/nfsd')
-rw-r--r-- | fs/nfsd/nfs4state.c | 10 | ||||
-rw-r--r-- | fs/nfsd/state.h | 7 |
2 files changed, 9 insertions, 8 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 75faacb03e8e..f5fc5d72c362 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -272,7 +272,7 @@ static void nfsd4_free_file_rcu(struct rcu_head *rcu) | |||
272 | kmem_cache_free(file_slab, fp); | 272 | kmem_cache_free(file_slab, fp); |
273 | } | 273 | } |
274 | 274 | ||
275 | static inline void | 275 | void |
276 | put_nfs4_file(struct nfs4_file *fi) | 276 | put_nfs4_file(struct nfs4_file *fi) |
277 | { | 277 | { |
278 | might_lock(&state_lock); | 278 | might_lock(&state_lock); |
@@ -285,12 +285,6 @@ put_nfs4_file(struct nfs4_file *fi) | |||
285 | } | 285 | } |
286 | } | 286 | } |
287 | 287 | ||
288 | static inline void | ||
289 | get_nfs4_file(struct nfs4_file *fi) | ||
290 | { | ||
291 | atomic_inc(&fi->fi_ref); | ||
292 | } | ||
293 | |||
294 | static struct file * | 288 | static struct file * |
295 | __nfs4_get_fd(struct nfs4_file *f, int oflag) | 289 | __nfs4_get_fd(struct nfs4_file *f, int oflag) |
296 | { | 290 | { |
@@ -3295,7 +3289,7 @@ find_file_locked(struct knfsd_fh *fh, unsigned int hashval) | |||
3295 | return NULL; | 3289 | return NULL; |
3296 | } | 3290 | } |
3297 | 3291 | ||
3298 | static struct nfs4_file * | 3292 | struct nfs4_file * |
3299 | find_file(struct knfsd_fh *fh) | 3293 | find_file(struct knfsd_fh *fh) |
3300 | { | 3294 | { |
3301 | struct nfs4_file *fp; | 3295 | struct nfs4_file *fp; |
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 55a3ece5fe06..8bc961e192f2 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -573,6 +573,13 @@ extern struct nfs4_client_reclaim *nfs4_client_to_reclaim(const char *name, | |||
573 | struct nfsd_net *nn); | 573 | struct nfsd_net *nn); |
574 | extern bool nfs4_has_reclaimed_state(const char *name, struct nfsd_net *nn); | 574 | extern bool nfs4_has_reclaimed_state(const char *name, struct nfsd_net *nn); |
575 | 575 | ||
576 | struct nfs4_file *find_file(struct knfsd_fh *fh); | ||
577 | void put_nfs4_file(struct nfs4_file *fi); | ||
578 | static inline void get_nfs4_file(struct nfs4_file *fi) | ||
579 | { | ||
580 | atomic_inc(&fi->fi_ref); | ||
581 | } | ||
582 | |||
576 | /* grace period management */ | 583 | /* grace period management */ |
577 | void nfsd4_end_grace(struct nfsd_net *nn); | 584 | void nfsd4_end_grace(struct nfsd_net *nn); |
578 | 585 | ||