nfs41: nfs41_setup_state_renewal
Move call to get the lease time and the setup of the state renewal out of nfs4_create_session so that it can be called after clearing the DRAINING flag. We use the getattr RPC to obtain the lease time, which requires a sequence slot. Signed-off-by: Ricardo Labiaga <Ricardo.Labiaga@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:

committed by
Trond Myklebust

parent
bcb56164ce
commit
9430fb6b53
@@ -4745,7 +4745,6 @@ int nfs4_proc_create_session(struct nfs_client *clp)
|
||||
{
|
||||
int status;
|
||||
unsigned *ptr;
|
||||
struct nfs_fsinfo fsinfo;
|
||||
struct nfs4_session *session = clp->cl_session;
|
||||
|
||||
dprintk("--> %s clp=%p session=%p\n", __func__, clp, session);
|
||||
@@ -4767,18 +4766,6 @@ int nfs4_proc_create_session(struct nfs_client *clp)
|
||||
ptr = (unsigned *)&session->sess_id.data[0];
|
||||
dprintk("%s client>seqid %d sessionid %u:%u:%u:%u\n", __func__,
|
||||
clp->cl_seqid, ptr[0], ptr[1], ptr[2], ptr[3]);
|
||||
|
||||
/* Get the lease time */
|
||||
status = nfs4_proc_get_lease_time(clp, &fsinfo);
|
||||
if (status == 0) {
|
||||
/* Update lease time and schedule renewal */
|
||||
spin_lock(&clp->cl_lock);
|
||||
clp->cl_lease_time = fsinfo.lease_time * HZ;
|
||||
clp->cl_last_renewal = jiffies;
|
||||
spin_unlock(&clp->cl_lock);
|
||||
|
||||
nfs4_schedule_state_renewal(clp);
|
||||
}
|
||||
out:
|
||||
dprintk("<-- %s\n", __func__);
|
||||
return status;
|
||||
|
Reference in New Issue
Block a user