aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeff Layton <jlayton@primarydata.com>2014-07-30 08:27:12 -0400
committerJ. Bruce Fields <bfields@redhat.com>2014-08-01 16:28:25 -0400
commit97403d95e1a7f5b257e90aad1f3284953bc72671 (patch)
tree2dc3da6b079bb0240606d6672ad79d77e3a6b9ce
parent217526e7ecc9f6f243e976772e81eab7ab986a4c (diff)
nfsd: move unhash_client_locked call into mark_client_expired_locked
All the callers except for the fault injection code call it directly afterward, and in the fault injection case it won't hurt to do so anyway. Signed-off-by: Jeff Layton <jlayton@primarydata.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
-rw-r--r--fs/nfsd/nfs4state.c19
1 files changed, 8 insertions, 11 deletions
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index 818480035453..56999cbe84a7 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -129,14 +129,6 @@ static bool is_client_expired(struct nfs4_client *clp)
129 return clp->cl_time == 0; 129 return clp->cl_time == 0;
130} 130}
131 131
132static __be32 mark_client_expired_locked(struct nfs4_client *clp)
133{
134 if (atomic_read(&clp->cl_refcount))
135 return nfserr_jukebox;
136 clp->cl_time = 0;
137 return nfs_ok;
138}
139
140static __be32 get_client_locked(struct nfs4_client *clp) 132static __be32 get_client_locked(struct nfs4_client *clp)
141{ 133{
142 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id); 134 struct nfsd_net *nn = net_generic(clp->net, nfsd_net_id);
@@ -1628,6 +1620,14 @@ unhash_client(struct nfs4_client *clp)
1628 spin_unlock(&nn->client_lock); 1620 spin_unlock(&nn->client_lock);
1629} 1621}
1630 1622
1623static __be32 mark_client_expired_locked(struct nfs4_client *clp)
1624{
1625 if (atomic_read(&clp->cl_refcount))
1626 return nfserr_jukebox;
1627 unhash_client_locked(clp);
1628 return nfs_ok;
1629}
1630
1631static void 1631static void
1632__destroy_client(struct nfs4_client *clp) 1632__destroy_client(struct nfs4_client *clp)
1633{ 1633{
@@ -2498,7 +2498,6 @@ nfsd4_create_session(struct svc_rqst *rqstp,
2498 status = mark_client_expired_locked(old); 2498 status = mark_client_expired_locked(old);
2499 if (status) 2499 if (status)
2500 goto out_free_conn; 2500 goto out_free_conn;
2501 unhash_client_locked(old);
2502 } 2501 }
2503 move_to_confirmed(unconf); 2502 move_to_confirmed(unconf);
2504 conf = unconf; 2503 conf = unconf;
@@ -3044,7 +3043,6 @@ nfsd4_setclientid_confirm(struct svc_rqst *rqstp,
3044 status = mark_client_expired_locked(old); 3043 status = mark_client_expired_locked(old);
3045 if (status) 3044 if (status)
3046 goto out; 3045 goto out;
3047 unhash_client_locked(old);
3048 } 3046 }
3049 move_to_confirmed(unconf); 3047 move_to_confirmed(unconf);
3050 conf = unconf; 3048 conf = unconf;
@@ -4183,7 +4181,6 @@ nfs4_laundromat(struct nfsd_net *nn)
4183 clp->cl_clientid.cl_id); 4181 clp->cl_clientid.cl_id);
4184 continue; 4182 continue;
4185 } 4183 }
4186 unhash_client_locked(clp);
4187 list_add(&clp->cl_lru, &reaplist); 4184 list_add(&clp->cl_lru, &reaplist);
4188 } 4185 }
4189 spin_unlock(&nn->client_lock); 4186 spin_unlock(&nn->client_lock);