Commit 1a47e7a6 authored by Trond Myklebust's avatar Trond Myklebust

NFSv4.1: Cleanup - move nfs4_has_session tests out of state manager loop

Signed-off-by: default avatarTrond Myklebust <Trond.Myklebust@netapp.com>
parent 60f00153
...@@ -1764,6 +1764,8 @@ static int nfs4_reset_session(struct nfs_client *clp) ...@@ -1764,6 +1764,8 @@ static int nfs4_reset_session(struct nfs_client *clp)
struct rpc_cred *cred; struct rpc_cred *cred;
int status; int status;
if (!nfs4_has_session(clp))
return 0;
nfs4_begin_drain_session(clp); nfs4_begin_drain_session(clp);
cred = nfs4_get_exchange_id_cred(clp); cred = nfs4_get_exchange_id_cred(clp);
status = nfs4_proc_destroy_session(clp->cl_session, cred); status = nfs4_proc_destroy_session(clp->cl_session, cred);
...@@ -1824,6 +1826,8 @@ static int nfs4_bind_conn_to_session(struct nfs_client *clp) ...@@ -1824,6 +1826,8 @@ static int nfs4_bind_conn_to_session(struct nfs_client *clp)
struct rpc_cred *cred; struct rpc_cred *cred;
int ret; int ret;
if (!nfs4_has_session(clp))
return 0;
nfs4_begin_drain_session(clp); nfs4_begin_drain_session(clp);
cred = nfs4_get_exchange_id_cred(clp); cred = nfs4_get_exchange_id_cred(clp);
ret = nfs4_proc_bind_conn_to_session(clp, cred); ret = nfs4_proc_bind_conn_to_session(clp, cred);
...@@ -1901,8 +1905,7 @@ static void nfs4_state_manager(struct nfs_client *clp) ...@@ -1901,8 +1905,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
} }
/* Initialize or reset the session */ /* Initialize or reset the session */
if (test_and_clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state) if (test_and_clear_bit(NFS4CLNT_SESSION_RESET, &clp->cl_state)) {
&& nfs4_has_session(clp)) {
section = "reset session"; section = "reset session";
status = nfs4_reset_session(clp); status = nfs4_reset_session(clp);
if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state)) if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state))
...@@ -1913,7 +1916,7 @@ static void nfs4_state_manager(struct nfs_client *clp) ...@@ -1913,7 +1916,7 @@ static void nfs4_state_manager(struct nfs_client *clp)
/* Send BIND_CONN_TO_SESSION */ /* Send BIND_CONN_TO_SESSION */
if (test_and_clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION, if (test_and_clear_bit(NFS4CLNT_BIND_CONN_TO_SESSION,
&clp->cl_state) && nfs4_has_session(clp)) { &clp->cl_state)) {
section = "bind conn to session"; section = "bind conn to session";
status = nfs4_bind_conn_to_session(clp); status = nfs4_bind_conn_to_session(clp);
if (status < 0) if (status < 0)
......
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