diff options
author | Jeff Layton <jlayton@redhat.com> | 2012-11-12 15:00:53 -0500 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2012-11-12 18:55:11 -0500 |
commit | ce30e5392fcb26b6aa53bb16d06da1d7d8bb0863 (patch) | |
tree | e5af94c019f84c460203f7e8ef449e7d1d74515c | |
parent | 278c931cb05ae624df8c82b6bdfbb0e03392cde7 (diff) |
nfsd: break out reclaim record removal into separate function
We'll need to be able to call this from nfs4recover.c eventually.
Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r-- | fs/nfsd/nfs4state.c | 12 | ||||
-rw-r--r-- | fs/nfsd/state.h | 1 |
2 files changed, 10 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index 18e554942da3..24dcda2b327c 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -4517,6 +4517,14 @@ nfs4_client_to_reclaim(const char *name) | |||
4517 | } | 4517 | } |
4518 | 4518 | ||
4519 | void | 4519 | void |
4520 | nfs4_remove_reclaim_record(struct nfs4_client_reclaim *crp) | ||
4521 | { | ||
4522 | list_del(&crp->cr_strhash); | ||
4523 | kfree(crp); | ||
4524 | reclaim_str_hashtbl_size--; | ||
4525 | } | ||
4526 | |||
4527 | void | ||
4520 | nfs4_release_reclaim(void) | 4528 | nfs4_release_reclaim(void) |
4521 | { | 4529 | { |
4522 | struct nfs4_client_reclaim *crp = NULL; | 4530 | struct nfs4_client_reclaim *crp = NULL; |
@@ -4526,9 +4534,7 @@ nfs4_release_reclaim(void) | |||
4526 | while (!list_empty(&reclaim_str_hashtbl[i])) { | 4534 | while (!list_empty(&reclaim_str_hashtbl[i])) { |
4527 | crp = list_entry(reclaim_str_hashtbl[i].next, | 4535 | crp = list_entry(reclaim_str_hashtbl[i].next, |
4528 | struct nfs4_client_reclaim, cr_strhash); | 4536 | struct nfs4_client_reclaim, cr_strhash); |
4529 | list_del(&crp->cr_strhash); | 4537 | nfs4_remove_reclaim_record(crp); |
4530 | kfree(crp); | ||
4531 | reclaim_str_hashtbl_size--; | ||
4532 | } | 4538 | } |
4533 | } | 4539 | } |
4534 | BUG_ON(reclaim_str_hashtbl_size); | 4540 | BUG_ON(reclaim_str_hashtbl_size); |
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h index c41c28020cad..3528616c955e 100644 --- a/fs/nfsd/state.h +++ b/fs/nfsd/state.h | |||
@@ -465,6 +465,7 @@ extern __be32 nfs4_preprocess_stateid_op(struct net *net, | |||
465 | extern void nfs4_lock_state(void); | 465 | extern void nfs4_lock_state(void); |
466 | extern void nfs4_unlock_state(void); | 466 | extern void nfs4_unlock_state(void); |
467 | extern int nfs4_in_grace(void); | 467 | extern int nfs4_in_grace(void); |
468 | void nfs4_remove_reclaim_record(struct nfs4_client_reclaim *); | ||
468 | extern void nfs4_release_reclaim(void); | 469 | extern void nfs4_release_reclaim(void); |
469 | extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(const char *recdir); | 470 | extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(const char *recdir); |
470 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid, bool sessions); | 471 | extern __be32 nfs4_check_open_reclaim(clientid_t *clid, bool sessions); |