diff options
Diffstat (limited to 'fs/lockd')
-rw-r--r-- | fs/lockd/clntlock.c | 14 | ||||
-rw-r--r-- | fs/lockd/clntproc.c | 6 | ||||
-rw-r--r-- | fs/lockd/host.c | 1 | ||||
-rw-r--r-- | fs/lockd/mon.c | 1 | ||||
-rw-r--r-- | fs/lockd/svcsubs.c | 2 |
5 files changed, 17 insertions, 7 deletions
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index a2717408c478..0796c45d0d4d 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c | |||
@@ -11,7 +11,7 @@ | |||
11 | #include <linux/slab.h> | 11 | #include <linux/slab.h> |
12 | #include <linux/time.h> | 12 | #include <linux/time.h> |
13 | #include <linux/nfs_fs.h> | 13 | #include <linux/nfs_fs.h> |
14 | #include <linux/sunrpc/clnt.h> | 14 | #include <linux/sunrpc/addr.h> |
15 | #include <linux/sunrpc/svc.h> | 15 | #include <linux/sunrpc/svc.h> |
16 | #include <linux/lockd/lockd.h> | 16 | #include <linux/lockd/lockd.h> |
17 | #include <linux/kthread.h> | 17 | #include <linux/kthread.h> |
@@ -220,10 +220,19 @@ reclaimer(void *ptr) | |||
220 | { | 220 | { |
221 | struct nlm_host *host = (struct nlm_host *) ptr; | 221 | struct nlm_host *host = (struct nlm_host *) ptr; |
222 | struct nlm_wait *block; | 222 | struct nlm_wait *block; |
223 | struct nlm_rqst *req; | ||
223 | struct file_lock *fl, *next; | 224 | struct file_lock *fl, *next; |
224 | u32 nsmstate; | 225 | u32 nsmstate; |
225 | struct net *net = host->net; | 226 | struct net *net = host->net; |
226 | 227 | ||
228 | req = kmalloc(sizeof(*req), GFP_KERNEL); | ||
229 | if (!req) { | ||
230 | printk(KERN_ERR "lockd: reclaimer unable to alloc memory." | ||
231 | " Locks for %s won't be reclaimed!\n", | ||
232 | host->h_name); | ||
233 | return 0; | ||
234 | } | ||
235 | |||
227 | allow_signal(SIGKILL); | 236 | allow_signal(SIGKILL); |
228 | 237 | ||
229 | down_write(&host->h_rwsem); | 238 | down_write(&host->h_rwsem); |
@@ -253,7 +262,7 @@ restart: | |||
253 | */ | 262 | */ |
254 | if (signalled()) | 263 | if (signalled()) |
255 | continue; | 264 | continue; |
256 | if (nlmclnt_reclaim(host, fl) != 0) | 265 | if (nlmclnt_reclaim(host, fl, req) != 0) |
257 | continue; | 266 | continue; |
258 | list_add_tail(&fl->fl_u.nfs_fl.list, &host->h_granted); | 267 | list_add_tail(&fl->fl_u.nfs_fl.list, &host->h_granted); |
259 | if (host->h_nsmstate != nsmstate) { | 268 | if (host->h_nsmstate != nsmstate) { |
@@ -279,5 +288,6 @@ restart: | |||
279 | /* Release host handle after use */ | 288 | /* Release host handle after use */ |
280 | nlmclnt_release_host(host); | 289 | nlmclnt_release_host(host); |
281 | lockd_down(net); | 290 | lockd_down(net); |
291 | kfree(req); | ||
282 | return 0; | 292 | return 0; |
283 | } | 293 | } |
diff --git a/fs/lockd/clntproc.c b/fs/lockd/clntproc.c index 366277190b82..7e529c3c45c0 100644 --- a/fs/lockd/clntproc.c +++ b/fs/lockd/clntproc.c | |||
@@ -618,17 +618,15 @@ out_unlock: | |||
618 | * RECLAIM: Try to reclaim a lock | 618 | * RECLAIM: Try to reclaim a lock |
619 | */ | 619 | */ |
620 | int | 620 | int |
621 | nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl) | 621 | nlmclnt_reclaim(struct nlm_host *host, struct file_lock *fl, |
622 | struct nlm_rqst *req) | ||
622 | { | 623 | { |
623 | struct nlm_rqst reqst, *req; | ||
624 | int status; | 624 | int status; |
625 | 625 | ||
626 | req = &reqst; | ||
627 | memset(req, 0, sizeof(*req)); | 626 | memset(req, 0, sizeof(*req)); |
628 | locks_init_lock(&req->a_args.lock.fl); | 627 | locks_init_lock(&req->a_args.lock.fl); |
629 | locks_init_lock(&req->a_res.lock.fl); | 628 | locks_init_lock(&req->a_res.lock.fl); |
630 | req->a_host = host; | 629 | req->a_host = host; |
631 | req->a_flags = 0; | ||
632 | 630 | ||
633 | /* Set up the argument struct */ | 631 | /* Set up the argument struct */ |
634 | nlmclnt_setlockargs(req, fl); | 632 | nlmclnt_setlockargs(req, fl); |
diff --git a/fs/lockd/host.c b/fs/lockd/host.c index abdd75d44dd4..969d589c848d 100644 --- a/fs/lockd/host.c +++ b/fs/lockd/host.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/in.h> | 13 | #include <linux/in.h> |
14 | #include <linux/in6.h> | 14 | #include <linux/in6.h> |
15 | #include <linux/sunrpc/clnt.h> | 15 | #include <linux/sunrpc/clnt.h> |
16 | #include <linux/sunrpc/addr.h> | ||
16 | #include <linux/sunrpc/svc.h> | 17 | #include <linux/sunrpc/svc.h> |
17 | #include <linux/lockd/lockd.h> | 18 | #include <linux/lockd/lockd.h> |
18 | #include <linux/mutex.h> | 19 | #include <linux/mutex.h> |
diff --git a/fs/lockd/mon.c b/fs/lockd/mon.c index 3c2cfc683631..1812f026960c 100644 --- a/fs/lockd/mon.c +++ b/fs/lockd/mon.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/slab.h> | 12 | #include <linux/slab.h> |
13 | 13 | ||
14 | #include <linux/sunrpc/clnt.h> | 14 | #include <linux/sunrpc/clnt.h> |
15 | #include <linux/sunrpc/addr.h> | ||
15 | #include <linux/sunrpc/xprtsock.h> | 16 | #include <linux/sunrpc/xprtsock.h> |
16 | #include <linux/sunrpc/svc.h> | 17 | #include <linux/sunrpc/svc.h> |
17 | #include <linux/lockd/lockd.h> | 18 | #include <linux/lockd/lockd.h> |
diff --git a/fs/lockd/svcsubs.c b/fs/lockd/svcsubs.c index d17bb62b06d6..97e87415b145 100644 --- a/fs/lockd/svcsubs.c +++ b/fs/lockd/svcsubs.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/mutex.h> | 14 | #include <linux/mutex.h> |
15 | #include <linux/sunrpc/svc.h> | 15 | #include <linux/sunrpc/svc.h> |
16 | #include <linux/sunrpc/clnt.h> | 16 | #include <linux/sunrpc/addr.h> |
17 | #include <linux/nfsd/nfsfh.h> | 17 | #include <linux/nfsd/nfsfh.h> |
18 | #include <linux/nfsd/export.h> | 18 | #include <linux/nfsd/export.h> |
19 | #include <linux/lockd/lockd.h> | 19 | #include <linux/lockd/lockd.h> |