diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-11-13 00:00:54 +0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-11-13 03:55:11 +0400 |
commit | 772a9bbbb5769c646c74452ef21df538bbe2ebf0 (patch) | |
tree | 6e29c687607641582d77544361512494a2d2513a /fs | |
parent | ce30e5392fcb26b6aa53bb16d06da1d7d8bb0863 (diff) | |
download | linux-772a9bbbb5769c646c74452ef21df538bbe2ebf0.tar.xz |
nfsd: make nfs4_client_to_reclaim return a pointer to the reclaim record
Later callers will need to make changes to the record.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/nfsd/nfs4state.c | 20 | ||||
-rw-r--r-- | fs/nfsd/state.h | 2 |
2 files changed, 11 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 24dcda2b327c..1c6f82e4335e 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c @@ -4498,22 +4498,22 @@ nfs4_has_reclaimed_state(const char *name) /* * failure => all reset bets are off, nfserr_no_grace... */ -int +struct nfs4_client_reclaim * nfs4_client_to_reclaim(const char *name) { unsigned int strhashval; - struct nfs4_client_reclaim *crp = NULL; + struct nfs4_client_reclaim *crp; dprintk("NFSD nfs4_client_to_reclaim NAME: %.*s\n", HEXDIR_LEN, name); crp = alloc_reclaim(); - if (!crp) - return 0; - strhashval = clientstr_hashval(name); - INIT_LIST_HEAD(&crp->cr_strhash); - list_add(&crp->cr_strhash, &reclaim_str_hashtbl[strhashval]); - memcpy(crp->cr_recdir, name, HEXDIR_LEN); - reclaim_str_hashtbl_size++; - return 1; + if (crp) { + strhashval = clientstr_hashval(name); + INIT_LIST_HEAD(&crp->cr_strhash); + list_add(&crp->cr_strhash, &reclaim_str_hashtbl[strhashval]); + memcpy(crp->cr_recdir, name, HEXDIR_LEN); + reclaim_str_hashtbl_size++; + } + return crp; } void diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index 3528616c955e..3f8b26b9b47b 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h @@ -482,7 +482,7 @@ extern void nfsd4_destroy_callback_queue(void); extern void nfsd4_shutdown_callback(struct nfs4_client *); extern void nfs4_put_delegation(struct nfs4_delegation *dp); extern __be32 nfs4_make_rec_clidname(char *clidname, struct xdr_netobj *clname); -extern int nfs4_client_to_reclaim(const char *name); +extern struct nfs4_client_reclaim *nfs4_client_to_reclaim(const char *name); extern int nfs4_has_reclaimed_state(const char *name); extern void release_session_client(struct nfsd4_session *); extern void nfsd4_purge_closed_stateid(struct nfs4_stateowner *); |