From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2993124AbXDSHCf (ORCPT ); Thu, 19 Apr 2007 03:02:35 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S2993123AbXDSHBk (ORCPT ); Thu, 19 Apr 2007 03:01:40 -0400 Received: from ebiederm.dsl.xmission.com ([166.70.28.69]:46351 "EHLO ebiederm.dsl.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161175AbXDSHB0 (ORCPT ); Thu, 19 Apr 2007 03:01:26 -0400 From: "Eric W. Biederman" To: " Cc: , Oleg Nesterov , Christoph Hellwig , , "Eric W. Biederman" Subject: [PATCH] nfs lockd reclaimer: Convert to kthread API Date: Thu, 19 Apr 2007 00:55:54 -0600 Message-Id: <11769658101858-git-send-email-ebiederm@xmission.com> X-Mailer: git-send-email 1.5.0.rc1.gb60d In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: Eric W. Biederman - unquoted Start the reclaimer thread using kthread_run instead of a combination of kernel_thread and daemonize. The small amount of signal handling code is also removed as it makes no sense and is a maintenance problem to handle signals in kernel threads. Cc: Neil Brown Cc: Trond Myklebust Signed-off-by: Eric W. Biederman --- fs/lockd/clntlock.c | 8 ++------ 1 files changed, 2 insertions(+), 6 deletions(-) diff --git a/fs/lockd/clntlock.c b/fs/lockd/clntlock.c index f4d45d4..83591f6 100644 --- a/fs/lockd/clntlock.c +++ b/fs/lockd/clntlock.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include #include @@ -153,7 +154,7 @@ nlmclnt_recovery(struct nlm_host *host) if (!host->h_reclaiming++) { nlm_get_host(host); __module_get(THIS_MODULE); - if (kernel_thread(reclaimer, host, CLONE_KERNEL) < 0) + if (IS_ERR(kthread_run(reclaimer, host, "%s-reclaim", host->h_name))) module_put(THIS_MODULE); } } @@ -166,9 +167,6 @@ reclaimer(void *ptr) struct file_lock *fl, *next; u32 nsmstate; - daemonize("%s-reclaim", host->h_name); - allow_signal(SIGKILL); - down_write(&host->h_rwsem); /* This one ensures that our parent doesn't terminate while the @@ -193,8 +191,6 @@ restart: list_del_init(&fl->fl_u.nfs_fl.list); /* Why are we leaking memory here? --okir */ - if (signalled()) - continue; if (nlmclnt_reclaim(host, fl) != 0) continue; list_add_tail(&fl->fl_u.nfs_fl.list, &host->h_granted); -- 1.5.0.g53756