Commit 3974552d authored by Trond Myklebust's avatar Trond Myklebust Committed by J. Bruce Fields

nfsd: Remove nfs4_lock_state(): exchange_id, create/destroy_session()

Also destroy_clientid and bind_conn_to_session.
Signed-off-by: default avatarTrond Myklebust <trond.myklebust@primarydata.com>
Signed-off-by: default avatarJ. Bruce Fields <bfields@redhat.com>
parent 3234975f
...@@ -2209,7 +2209,6 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -2209,7 +2209,6 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
return nfserr_jukebox; return nfserr_jukebox;
/* Cases below refer to rfc 5661 section 18.35.4: */ /* Cases below refer to rfc 5661 section 18.35.4: */
nfs4_lock_state();
spin_lock(&nn->client_lock); spin_lock(&nn->client_lock);
conf = find_confirmed_client_by_name(&exid->clname, nn); conf = find_confirmed_client_by_name(&exid->clname, nn);
if (conf) { if (conf) {
...@@ -2288,7 +2287,6 @@ nfsd4_exchange_id(struct svc_rqst *rqstp, ...@@ -2288,7 +2287,6 @@ nfsd4_exchange_id(struct svc_rqst *rqstp,
out: out:
spin_unlock(&nn->client_lock); spin_unlock(&nn->client_lock);
nfs4_unlock_state();
if (new) if (new)
expire_client(new); expire_client(new);
if (unconf) if (unconf)
...@@ -2462,7 +2460,6 @@ nfsd4_create_session(struct svc_rqst *rqstp, ...@@ -2462,7 +2460,6 @@ nfsd4_create_session(struct svc_rqst *rqstp,
if (!conn) if (!conn)
goto out_free_session; goto out_free_session;
nfs4_lock_state();
spin_lock(&nn->client_lock); spin_lock(&nn->client_lock);
unconf = find_unconfirmed_client(&cr_ses->clientid, true, nn); unconf = find_unconfirmed_client(&cr_ses->clientid, true, nn);
conf = find_confirmed_client(&cr_ses->clientid, true, nn); conf = find_confirmed_client(&cr_ses->clientid, true, nn);
...@@ -2532,13 +2529,11 @@ nfsd4_create_session(struct svc_rqst *rqstp, ...@@ -2532,13 +2529,11 @@ nfsd4_create_session(struct svc_rqst *rqstp,
/* init connection and backchannel */ /* init connection and backchannel */
nfsd4_init_conn(rqstp, conn, new); nfsd4_init_conn(rqstp, conn, new);
nfsd4_put_session(new); nfsd4_put_session(new);
nfs4_unlock_state();
if (old) if (old)
expire_client(old); expire_client(old);
return status; return status;
out_free_conn: out_free_conn:
spin_unlock(&nn->client_lock); spin_unlock(&nn->client_lock);
nfs4_unlock_state();
free_conn(conn); free_conn(conn);
if (old) if (old)
expire_client(old); expire_client(old);
...@@ -2594,7 +2589,6 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp, ...@@ -2594,7 +2589,6 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
if (!nfsd4_last_compound_op(rqstp)) if (!nfsd4_last_compound_op(rqstp))
return nfserr_not_only_op; return nfserr_not_only_op;
nfs4_lock_state();
spin_lock(&nn->client_lock); spin_lock(&nn->client_lock);
session = find_in_sessionid_hashtbl(&bcts->sessionid, net, &status); session = find_in_sessionid_hashtbl(&bcts->sessionid, net, &status);
spin_unlock(&nn->client_lock); spin_unlock(&nn->client_lock);
...@@ -2615,7 +2609,6 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp, ...@@ -2615,7 +2609,6 @@ __be32 nfsd4_bind_conn_to_session(struct svc_rqst *rqstp,
out: out:
nfsd4_put_session(session); nfsd4_put_session(session);
out_no_session: out_no_session:
nfs4_unlock_state();
return status; return status;
} }
...@@ -2637,7 +2630,6 @@ nfsd4_destroy_session(struct svc_rqst *r, ...@@ -2637,7 +2630,6 @@ nfsd4_destroy_session(struct svc_rqst *r,
struct net *net = SVC_NET(r); struct net *net = SVC_NET(r);
struct nfsd_net *nn = net_generic(net, nfsd_net_id); struct nfsd_net *nn = net_generic(net, nfsd_net_id);
nfs4_lock_state();
status = nfserr_not_only_op; status = nfserr_not_only_op;
if (nfsd4_compound_in_session(cstate->session, &sessionid->sessionid)) { if (nfsd4_compound_in_session(cstate->session, &sessionid->sessionid)) {
if (!nfsd4_last_compound_op(r)) if (!nfsd4_last_compound_op(r))
...@@ -2667,7 +2659,6 @@ nfsd4_destroy_session(struct svc_rqst *r, ...@@ -2667,7 +2659,6 @@ nfsd4_destroy_session(struct svc_rqst *r,
out_client_lock: out_client_lock:
spin_unlock(&nn->client_lock); spin_unlock(&nn->client_lock);
out: out:
nfs4_unlock_state();
return status; return status;
} }
...@@ -2870,7 +2861,6 @@ nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta ...@@ -2870,7 +2861,6 @@ nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta
__be32 status = 0; __be32 status = 0;
struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id); struct nfsd_net *nn = net_generic(SVC_NET(rqstp), nfsd_net_id);
nfs4_lock_state();
spin_lock(&nn->client_lock); spin_lock(&nn->client_lock);
unconf = find_unconfirmed_client(&dc->clientid, true, nn); unconf = find_unconfirmed_client(&dc->clientid, true, nn);
conf = find_confirmed_client(&dc->clientid, true, nn); conf = find_confirmed_client(&dc->clientid, true, nn);
...@@ -2899,7 +2889,6 @@ nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta ...@@ -2899,7 +2889,6 @@ nfsd4_destroy_clientid(struct svc_rqst *rqstp, struct nfsd4_compound_state *csta
unhash_client_locked(clp); unhash_client_locked(clp);
out: out:
spin_unlock(&nn->client_lock); spin_unlock(&nn->client_lock);
nfs4_unlock_state();
if (clp) if (clp)
expire_client(clp); expire_client(clp);
return status; return status;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment