Re: [PATCH] s390/scsi/zfcp_erp: Convert to use the kthread API
On Sunday 22 April 2007 22:17, Christoph Hellwig wrote: > On Thu, Apr 19, 2007 at 01:58:42AM -0600, Eric W. Biederman wrote: > > From: Eric W. Biederman <[EMAIL PROTECTED]> > > > > Modify zfcperp%s to be started with kthread_run not > > a combination of kernel_thread, daemonize and siginitsetinv > > making the code slightly simpler and more maintainable. > > This driver would also benefit from a full kthread conversion. > Unfortunately it has a strange dual-use semaphore (->erp_ready_sem) > that hinders a straight conversion. Maybe the maintainer can take > a look whether there's a nice way to get rid of that one? > I know and we have it on our schedule, but it's not as easy as it might look like . - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] s390/scsi/zfcp_erp: Convert to use the kthread API
On Thu, Apr 19, 2007 at 01:58:42AM -0600, Eric W. Biederman wrote: > From: Eric W. Biederman <[EMAIL PROTECTED]> > > Modify zfcperp%s to be started with kthread_run not > a combination of kernel_thread, daemonize and siginitsetinv > making the code slightly simpler and more maintainable. This driver would also benefit from a full kthread conversion. Unfortunately it has a strange dual-use semaphore (->erp_ready_sem) that hinders a straight conversion. Maybe the maintainer can take a look whether there's a nice way to get rid of that one? - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] s390/scsi/zfcp_erp: Convert to use the kthread API
From: Eric W. Biederman <[EMAIL PROTECTED]> Modify zfcperp%s to be started with kthread_run not a combination of kernel_thread, daemonize and siginitsetinv making the code slightly simpler and more maintainable. Cc: Swen Schillig <[EMAIL PROTECTED]> Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]> --- drivers/s390/scsi/zfcp_erp.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 66c0b09..f26536d 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -21,6 +21,7 @@ #define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP +#include #include "zfcp_ext.h" static int zfcp_erp_adisc(struct zfcp_port *); @@ -985,12 +986,13 @@ static void zfcp_erp_action_dismiss(struct zfcp_erp_action *erp_action) int zfcp_erp_thread_setup(struct zfcp_adapter *adapter) { - int retval = 0; + struct task_struct *task; atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); - retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD); - if (retval < 0) { + task = kthread_run(zfcp_erp_thread, adapter, + "zfcperp%s", zfcp_get_busid_by_adapter(adapter)); + if (IS_ERR(task)) { ZFCP_LOG_NORMAL("error: creation of erp thread failed for " "adapter %s\n", zfcp_get_busid_by_adapter(adapter)); @@ -1002,7 +1004,7 @@ zfcp_erp_thread_setup(struct zfcp_adapter *adapter) debug_text_event(adapter->erp_dbf, 5, "a_thset_ok"); } - return (retval < 0); + return IS_ERR(task); } /* @@ -1054,9 +1056,6 @@ zfcp_erp_thread(void *data) struct zfcp_erp_action *erp_action; unsigned long flags; - daemonize("zfcperp%s", zfcp_get_busid_by_adapter(adapter)); - /* Block all signals */ - siginitsetinv(¤t->blocked, 0); atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); debug_text_event(adapter->erp_dbf, 5, "a_th_run"); wake_up(&adapter->erp_thread_wqh); -- 1.5.0.g53756 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] s390/scsi/zfcp_erp: Convert to use the kthread API
From: Eric W. Biederman <[EMAIL PROTECTED]> - unquoted Modify zfcperp%s to be started with kthread_run not a combination of kernel_thread, daemonize and siginitsetinv making the code slightly simpler and more maintainable. Cc: Swen Schillig <[EMAIL PROTECTED]> Signed-off-by: Eric W. Biederman <[EMAIL PROTECTED]> --- drivers/s390/scsi/zfcp_erp.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/s390/scsi/zfcp_erp.c b/drivers/s390/scsi/zfcp_erp.c index 66c0b09..f26536d 100644 --- a/drivers/s390/scsi/zfcp_erp.c +++ b/drivers/s390/scsi/zfcp_erp.c @@ -21,6 +21,7 @@ #define ZFCP_LOG_AREA ZFCP_LOG_AREA_ERP +#include #include "zfcp_ext.h" static int zfcp_erp_adisc(struct zfcp_port *); @@ -985,12 +986,13 @@ static void zfcp_erp_action_dismiss(struct zfcp_erp_action *erp_action) int zfcp_erp_thread_setup(struct zfcp_adapter *adapter) { - int retval = 0; + struct task_struct *task; atomic_clear_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); - retval = kernel_thread(zfcp_erp_thread, adapter, SIGCHLD); - if (retval < 0) { + task = kthread_run(zfcp_erp_thread, adapter, + "zfcperp%s", zfcp_get_busid_by_adapter(adapter)); + if (IS_ERR(task)) { ZFCP_LOG_NORMAL("error: creation of erp thread failed for " "adapter %s\n", zfcp_get_busid_by_adapter(adapter)); @@ -1002,7 +1004,7 @@ zfcp_erp_thread_setup(struct zfcp_adapter *adapter) debug_text_event(adapter->erp_dbf, 5, "a_thset_ok"); } - return (retval < 0); + return IS_ERR(task); } /* @@ -1054,9 +1056,6 @@ zfcp_erp_thread(void *data) struct zfcp_erp_action *erp_action; unsigned long flags; - daemonize("zfcperp%s", zfcp_get_busid_by_adapter(adapter)); - /* Block all signals */ - siginitsetinv(¤t->blocked, 0); atomic_set_mask(ZFCP_STATUS_ADAPTER_ERP_THREAD_UP, &adapter->status); debug_text_event(adapter->erp_dbf, 5, "a_th_run"); wake_up(&adapter->erp_thread_wqh); -- 1.5.0.g53756 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/