NFSv4: Move nfs4_wait_clnt_recover and nfs4_client_recover_expired_lease
nfs4_wait_clnt_recover and nfs4_client_recover_expired_lease are both generic state related functions. As such, they belong in nfs4state.c, and not nfs4proc.c Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
This commit is contained in:
@@ -70,8 +70,6 @@
|
||||
#define NFS4_POLL_RETRY_MIN (HZ/10)
|
||||
#define NFS4_POLL_RETRY_MAX (15*HZ)
|
||||
|
||||
#define NFS4_MAX_LOOP_ON_RECOVER (10)
|
||||
|
||||
struct nfs4_opendata;
|
||||
static int _nfs4_proc_open(struct nfs4_opendata *data);
|
||||
static int _nfs4_recover_proc_open(struct nfs4_opendata *data);
|
||||
@@ -255,22 +253,6 @@ static void nfs4_setup_readdir(u64 cookie, __be32 *verifier, struct dentry *dent
|
||||
kunmap_atomic(start);
|
||||
}
|
||||
|
||||
static int nfs4_wait_clnt_recover(struct nfs_client *clp)
|
||||
{
|
||||
int res;
|
||||
|
||||
might_sleep();
|
||||
|
||||
res = wait_on_bit(&clp->cl_state, NFS4CLNT_MANAGER_RUNNING,
|
||||
nfs_wait_bit_killable, TASK_KILLABLE);
|
||||
if (res)
|
||||
return res;
|
||||
|
||||
if (clp->cl_cons_state < 0)
|
||||
return clp->cl_cons_state;
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nfs4_delay(struct rpc_clnt *clnt, long *timeout)
|
||||
{
|
||||
int res = 0;
|
||||
@@ -1883,24 +1865,6 @@ static int _nfs4_proc_open(struct nfs4_opendata *data)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nfs4_client_recover_expired_lease(struct nfs_client *clp)
|
||||
{
|
||||
unsigned int loop;
|
||||
int ret;
|
||||
|
||||
for (loop = NFS4_MAX_LOOP_ON_RECOVER; loop != 0; loop--) {
|
||||
ret = nfs4_wait_clnt_recover(clp);
|
||||
if (ret != 0)
|
||||
break;
|
||||
if (!test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) &&
|
||||
!test_bit(NFS4CLNT_CHECK_LEASE,&clp->cl_state))
|
||||
break;
|
||||
nfs4_schedule_state_manager(clp);
|
||||
ret = -EIO;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int nfs4_recover_expired_lease(struct nfs_server *server)
|
||||
{
|
||||
return nfs4_client_recover_expired_lease(server->nfs_client);
|
||||
|
Reference in New Issue
Block a user