9 #include <linux/module.h>
10 #include <linux/types.h>
11 #include <linux/slab.h>
12 #include <linux/time.h>
13 #include <linux/nfs_fs.h>
19 #define NLMDBG_FACILITY NLMDBG_CLIENT
24 static int reclaimer(
void *
ptr);
55 struct nlm_host *
host;
61 return ERR_PTR(status);
83 struct net *
net = host->net;
104 spin_lock(&nlm_blocked_lock);
105 list_add(&block->
b_list, &nlm_blocked);
106 spin_unlock(&nlm_blocked_lock);
115 spin_lock(&nlm_blocked_lock);
117 spin_unlock(&nlm_blocked_lock);
147 req->a_res.status = block->
b_status;
157 const struct nfs_fh *fh = &lock->
fh;
165 spin_lock(&nlm_blocked_lock);
179 if (!rpc_cmp_addr(nlm_addr(block->
b_host), addr))
181 if (nfs_compare_fh(NFS_FH(fl_blocked->
fl_file->f_path.dentry->d_inode) ,fh) != 0)
190 spin_unlock(&nlm_blocked_lock);
208 if (!host->h_reclaiming++) {
210 task =
kthread_run(reclaimer, host,
"%s-reclaim", host->h_name);
213 "thread. Locks for %s won't be reclaimed! "
214 "(%ld)\n", host->h_name, PTR_ERR(task));
221 struct nlm_host *
host = (
struct nlm_host *) ptr;
225 struct net *
net = host->net;
232 dprintk(
"lockd: reclaiming locks for host %s\n", host->h_name);
235 nsmstate = host->h_nsmstate;
244 list_splice_init(&host->h_granted, &host->h_reclaim);
259 if (host->h_nsmstate != nsmstate) {
265 host->h_reclaiming = 0;
267 dprintk(
"NLM: done reclaiming locks for host %s\n", host->h_name);
270 spin_lock(&nlm_blocked_lock);
272 if (block->
b_host == host) {
277 spin_unlock(&nlm_blocked_lock);