aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/delegation.c')
-rw-r--r--fs/nfs/delegation.c31
1 files changed, 5 insertions, 26 deletions
diff --git a/fs/nfs/delegation.c b/fs/nfs/delegation.c
index 4692fdc8abf3..21eda6c083d0 100644
--- a/fs/nfs/delegation.c
+++ b/fs/nfs/delegation.c
@@ -354,37 +354,16 @@ static void nfs_client_mark_return_all_delegations(struct nfs_client *clp)
354 rcu_read_unlock(); 354 rcu_read_unlock();
355} 355}
356 356
357static int nfs_do_expire_all_delegations(void *ptr) 357static void nfs_delegation_run_state_manager(struct nfs_client *clp)
358{ 358{
359 struct nfs_client *clp = ptr; 359 if (test_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state))
360 360 nfs4_schedule_state_manager(clp);
361 allow_signal(SIGKILL);
362
363 if (test_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0)
364 goto out;
365 if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) == 0)
366 goto out;
367 nfs_client_mark_return_all_delegations(clp);
368 nfs_client_return_marked_delegations(clp);
369out:
370 nfs_put_client(clp);
371 module_put_and_exit(0);
372} 361}
373 362
374void nfs_expire_all_delegations(struct nfs_client *clp) 363void nfs_expire_all_delegations(struct nfs_client *clp)
375{ 364{
376 struct task_struct *task; 365 nfs_client_mark_return_all_delegations(clp);
377 366 nfs_delegation_run_state_manager(clp);
378 __module_get(THIS_MODULE);
379 atomic_inc(&clp->cl_count);
380 task = kthread_run(nfs_do_expire_all_delegations, clp,
381 "%s-delegreturn",
382 rpc_peeraddr2str(clp->cl_rpcclient,
383 RPC_DISPLAY_ADDR));
384 if (!IS_ERR(task))
385 return;
386 nfs_put_client(clp);
387 module_put(THIS_MODULE);
388} 367}
389 368
390/* 369/*