aboutsummaryrefslogtreecommitdiffstats
path: root/fs/lockd/svclock.c
diff options
context:
space:
mode:
authorJeff Layton <jlayton@redhat.com>2008-02-07 16:34:55 -0500
committerJ. Bruce Fields <bfields@citi.umich.edu>2008-04-23 16:13:36 -0400
commitd751a7cd0695554498f25d3026ca6710dbb3698f (patch)
tree31ec617dfb9fb70160bb8d2d9c9fd2e5c1e50c15 /fs/lockd/svclock.c
parent7086721f9c8b59331e164e534f588e075cfd9d3f (diff)
NLM: Convert lockd to use kthreads
Have lockd_up start lockd using kthread_run. With this change, lockd_down now blocks until lockd actually exits, so there's no longer need for the waitqueue code at the end of lockd_down. This also means that only one lockd can be running at a time which simplifies the code within lockd's main loop. This also adds a check for kthread_should_stop in the main loop of nlmsvc_retry_blocked and after that function returns. There's no sense continuing to retry blocks if lockd is coming down anyway. Signed-off-by: Jeff Layton <jlayton@redhat.com> Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Diffstat (limited to 'fs/lockd/svclock.c')
-rw-r--r--fs/lockd/svclock.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
index fe9bdb4a220c..4da7c4c27064 100644
--- a/fs/lockd/svclock.c
+++ b/fs/lockd/svclock.c
@@ -29,6 +29,7 @@
29#include <linux/sunrpc/svc.h> 29#include <linux/sunrpc/svc.h>
30#include <linux/lockd/nlm.h> 30#include <linux/lockd/nlm.h>
31#include <linux/lockd/lockd.h> 31#include <linux/lockd/lockd.h>
32#include <linux/kthread.h>
32 33
33#define NLMDBG_FACILITY NLMDBG_SVCLOCK 34#define NLMDBG_FACILITY NLMDBG_SVCLOCK
34 35
@@ -887,7 +888,7 @@ nlmsvc_retry_blocked(void)
887 unsigned long timeout = MAX_SCHEDULE_TIMEOUT; 888 unsigned long timeout = MAX_SCHEDULE_TIMEOUT;
888 struct nlm_block *block; 889 struct nlm_block *block;
889 890
890 while (!list_empty(&nlm_blocked)) { 891 while (!list_empty(&nlm_blocked) && !kthread_should_stop()) {
891 block = list_entry(nlm_blocked.next, struct nlm_block, b_list); 892 block = list_entry(nlm_blocked.next, struct nlm_block, b_list);
892 893
893 if (block->b_when == NLM_NEVER) 894 if (block->b_when == NLM_NEVER)