Skip to content

Commit e6ba76e

Browse files
author
Christoph Hellwig
committed
nfsd: make find/get/put file available outside nfs4state.c
Signed-off-by: Christoph Hellwig <hch@lst.de>
1 parent cd61c52 commit e6ba76e

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

fs/nfsd/nfs4state.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static void nfsd4_free_file_rcu(struct rcu_head *rcu)
272272
kmem_cache_free(file_slab, fp);
273273
}
274274

275-
static inline void
275+
void
276276
put_nfs4_file(struct nfs4_file *fi)
277277
{
278278
might_lock(&state_lock);
@@ -285,12 +285,6 @@ put_nfs4_file(struct nfs4_file *fi)
285285
}
286286
}
287287

288-
static inline void
289-
get_nfs4_file(struct nfs4_file *fi)
290-
{
291-
atomic_inc(&fi->fi_ref);
292-
}
293-
294288
static struct file *
295289
__nfs4_get_fd(struct nfs4_file *f, int oflag)
296290
{
@@ -3295,7 +3289,7 @@ find_file_locked(struct knfsd_fh *fh, unsigned int hashval)
32953289
return NULL;
32963290
}
32973291

3298-
static struct nfs4_file *
3292+
struct nfs4_file *
32993293
find_file(struct knfsd_fh *fh)
33003294
{
33013295
struct nfs4_file *fp;

fs/nfsd/state.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,13 @@ extern struct nfs4_client_reclaim *nfs4_client_to_reclaim(const char *name,
573573
struct nfsd_net *nn);
574574
extern bool nfs4_has_reclaimed_state(const char *name, struct nfsd_net *nn);
575575

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+
576583
/* grace period management */
577584
void nfsd4_end_grace(struct nfsd_net *nn);
578585

0 commit comments

Comments
 (0)