nfsd: break out reclaim record removal into separate function
authorJeff Layton <jlayton@redhat.com>
Mon, 12 Nov 2012 20:00:53 +0000 (15:00 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 12 Nov 2012 23:55:11 +0000 (18:55 -0500)
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>
fs/nfsd/nfs4state.c
fs/nfsd/state.h

index 18e554942da30249a532b8ac89cb291a5be0d98d..24dcda2b327c620cca1cae31b6a87a5195b93a86 100644 (file)
@@ -4516,6 +4516,14 @@ nfs4_client_to_reclaim(const char *name)
        return 1;
 }
 
+void
+nfs4_remove_reclaim_record(struct nfs4_client_reclaim *crp)
+{
+       list_del(&crp->cr_strhash);
+       kfree(crp);
+       reclaim_str_hashtbl_size--;
+}
+
 void
 nfs4_release_reclaim(void)
 {
@@ -4526,9 +4534,7 @@ nfs4_release_reclaim(void)
                while (!list_empty(&reclaim_str_hashtbl[i])) {
                        crp = list_entry(reclaim_str_hashtbl[i].next,
                                        struct nfs4_client_reclaim, cr_strhash);
-                       list_del(&crp->cr_strhash);
-                       kfree(crp);
-                       reclaim_str_hashtbl_size--;
+                       nfs4_remove_reclaim_record(crp);
                }
        }
        BUG_ON(reclaim_str_hashtbl_size);
index c41c28020cad8f9fb7c5e1647dd4d87836b63c0a..3528616c955e5a92e0b74f3589110d7d762d693e 100644 (file)
@@ -465,6 +465,7 @@ extern __be32 nfs4_preprocess_stateid_op(struct net *net,
 extern void nfs4_lock_state(void);
 extern void nfs4_unlock_state(void);
 extern int nfs4_in_grace(void);
+void nfs4_remove_reclaim_record(struct nfs4_client_reclaim *);
 extern void nfs4_release_reclaim(void);
 extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(const char *recdir);
 extern __be32 nfs4_check_open_reclaim(clientid_t *clid, bool sessions);