[PATCH] kthread: convert lock to use kthread

From: Serge E. Hallyn
Date: Wed Jun 14 2006 - 08:05:50 EST


Update lockd/clntlock.c to use kthread instead of a deprecated
kernel_thread.

Signed-off-by: Serge E. Hallyn <serue@xxxxxxxxxx>

---

fs/lockd/clntlock.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)

02ed734b2401bdebc92c4edaba5dbbd52ba091a7
diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c
index bce7444..4de7c59 100644
--- a/fs/lockd/clntlock.c
+++ b/fs/lockd/clntlock.c
@@ -14,6 +14,7 @@
#include <linux/sunrpc/svc.h>
#include <linux/lockd/lockd.h>
#include <linux/smp_lock.h>
+#include <linux/kthread.h>

#define NLMDBG_FACILITY NLMDBG_CLIENT

@@ -171,6 +172,8 @@ void nlmclnt_prepare_reclaim(struct nlm_
void
nlmclnt_recovery(struct nlm_host *host, u32 newstate)
{
+ struct task_struct *tsk;
+
if (host->h_reclaiming++) {
if (host->h_nsmstate == newstate)
return;
@@ -179,7 +182,9 @@ nlmclnt_recovery(struct nlm_host *host,
nlmclnt_prepare_reclaim(host, newstate);
nlm_get_host(host);
__module_get(THIS_MODULE);
- if (kernel_thread(reclaimer, host, CLONE_KERNEL) < 0)
+ tsk = kthread_run(reclaimer, host,
+ "%s-reclaim", host->h_name);
+ if (IS_ERR(tsk))
module_put(THIS_MODULE);
}
}
@@ -191,7 +196,6 @@ reclaimer(void *ptr)
struct nlm_wait *block;
struct file_lock *fl, *next;

- daemonize("%s-reclaim", host->h_name);
allow_signal(SIGKILL);

/* This one ensures that our parent doesn't terminate while the
--
1.1.6
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/