nfsd: have nfsd4_find_reclaim_client take a char * argument
authorJeff Layton <jlayton@redhat.com>
Mon, 12 Nov 2012 20:00:52 +0000 (15:00 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Mon, 12 Nov 2012 23:55:11 +0000 (18:55 -0500)
Currently, it takes a client pointer, but later we're going to need to
search for these records without knowing whether a matching client even
exists.

Signed-off-by: Jeff Layton <jlayton@redhat.com>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
fs/nfsd/nfs4recover.c
fs/nfsd/nfs4state.c
fs/nfsd/state.h

index 6aaf5d92a43c11af668a9d941e012c9ca73ebd99..4e92fb38cfb20212468e48860cbdbaf24bd67831 100644 (file)
@@ -486,7 +486,7 @@ nfsd4_check_legacy_client(struct nfs4_client *clp)
                return 0;
 
        /* look for it in the reclaim hashtable otherwise */
-       if (nfsd4_find_reclaim_client(clp)) {
+       if (nfsd4_find_reclaim_client(clp->cl_recdir)) {
                set_bit(NFSD4_CLIENT_STABLE, &clp->cl_flags);
                return 0;
        }
index d6b602a92657bcabefda62e8d7a973aeaedf114c..18e554942da30249a532b8ac89cb291a5be0d98d 100644 (file)
@@ -4537,19 +4537,16 @@ nfs4_release_reclaim(void)
 /*
  * called from OPEN, CLAIM_PREVIOUS with a new clientid. */
 struct nfs4_client_reclaim *
-nfsd4_find_reclaim_client(struct nfs4_client *clp)
+nfsd4_find_reclaim_client(const char *recdir)
 {
        unsigned int strhashval;
        struct nfs4_client_reclaim *crp = NULL;
 
-       dprintk("NFSD: nfs4_find_reclaim_client for %.*s with recdir %s\n",
-                           clp->cl_name.len, clp->cl_name.data,
-                           clp->cl_recdir);
+       dprintk("NFSD: nfs4_find_reclaim_client for recdir %s\n", recdir);
 
-       /* find clp->cl_name in reclaim_str_hashtbl */
-       strhashval = clientstr_hashval(clp->cl_recdir);
+       strhashval = clientstr_hashval(recdir);
        list_for_each_entry(crp, &reclaim_str_hashtbl[strhashval], cr_strhash) {
-               if (same_name(crp->cr_recdir, clp->cl_recdir)) {
+               if (same_name(crp->cr_recdir, recdir)) {
                        return crp;
                }
        }
index 8053b5747960af9ffc030df4980961d5a372fdb6..c41c28020cad8f9fb7c5e1647dd4d87836b63c0a 100644 (file)
@@ -466,7 +466,7 @@ extern void nfs4_lock_state(void);
 extern void nfs4_unlock_state(void);
 extern int nfs4_in_grace(void);
 extern void nfs4_release_reclaim(void);
-extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(struct nfs4_client *crp);
+extern struct nfs4_client_reclaim *nfsd4_find_reclaim_client(const char *recdir);
 extern __be32 nfs4_check_open_reclaim(clientid_t *clid, bool sessions);
 extern void nfs4_free_openowner(struct nfs4_openowner *);
 extern void nfs4_free_lockowner(struct nfs4_lockowner *);