aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-12-23 15:21:50 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-12-23 15:21:50 -0500
commitb0d3ded1a21dc3057daff5a488469d9e6aa1b567 (patch)
tree1e30c75402d091e19219d73850879317bb345b87 /fs/nfs/delegation.c
parent0d62f85a81216f30a0ba1479b93e84103a5d535b (diff)
NFSv4: Clean up nfs_expire_all_delegations()
Let the actual delegreturn stuff be run in the state manager thread rather than allocating a separate kthread. Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
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/*