summaryrefslogtreecommitdiffstats
path: root/fs/nfs/delegation.c
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2008-12-23 21:21:50 +0100
committerTrond Myklebust <Trond.Myklebust@netapp.com>2008-12-23 21:21:50 +0100
commitb0d3ded1a21dc3057daff5a488469d9e6aa1b567 (patch)
tree1e30c75402d091e19219d73850879317bb345b87 /fs/nfs/delegation.c
parentNFSv4: Fix a BAD_SEQUENCEID condition. (diff)
downloadlinux-b0d3ded1a21dc3057daff5a488469d9e6aa1b567.tar.xz
linux-b0d3ded1a21dc3057daff5a488469d9e6aa1b567.zip
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)
rcu_read_unlock();
}
-static int nfs_do_expire_all_delegations(void *ptr)
+static void nfs_delegation_run_state_manager(struct nfs_client *clp)
{
- struct nfs_client *clp = ptr;
-
- allow_signal(SIGKILL);
-
- if (test_bit(NFS4CLNT_MANAGER_RUNNING, &clp->cl_state) != 0)
- goto out;
- if (test_bit(NFS4CLNT_LEASE_EXPIRED, &clp->cl_state) == 0)
- goto out;
- nfs_client_mark_return_all_delegations(clp);
- nfs_client_return_marked_delegations(clp);
-out:
- nfs_put_client(clp);
- module_put_and_exit(0);
+ if (test_bit(NFS4CLNT_DELEGRETURN, &clp->cl_state))
+ nfs4_schedule_state_manager(clp);
}
void nfs_expire_all_delegations(struct nfs_client *clp)
{
- struct task_struct *task;
-
- __module_get(THIS_MODULE);
- atomic_inc(&clp->cl_count);
- task = kthread_run(nfs_do_expire_all_delegations, clp,
- "%s-delegreturn",
- rpc_peeraddr2str(clp->cl_rpcclient,
- RPC_DISPLAY_ADDR));
- if (!IS_ERR(task))
- return;
- nfs_put_client(clp);
- module_put(THIS_MODULE);
+ nfs_client_mark_return_all_delegations(clp);
+ nfs_delegation_run_state_manager(clp);
}
/*