diff options
author | Christoph Hellwig <hch@lst.de> | 2006-02-14 18:45:06 +0100 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-02-27 22:55:14 -0600 |
commit | fe27381d16c6683c55e618360d0d11bd43647e43 (patch) | |
tree | 142cd1c8661480081b293fe50de9354b0b181ffd /drivers/scsi/aacraid/commsup.c | |
parent | 38e14f895b212943995379dea824cc52b0c25991 (diff) |
[SCSI] aacraid: use kthread_ API
Use the kthread_ API instead of opencoding lots of hairy code for kernel
thread creation and teardown.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Salyzyn, Mark <mark_salyzyn@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/aacraid/commsup.c')
-rw-r--r-- | drivers/scsi/aacraid/commsup.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c index 609fd19b184..c7f80ec7abd 100644 --- a/drivers/scsi/aacraid/commsup.c +++ b/drivers/scsi/aacraid/commsup.c @@ -39,6 +39,7 @@ #include <linux/completion.h> #include <linux/blkdev.h> #include <linux/delay.h> +#include <linux/kthread.h> #include <scsi/scsi_host.h> #include <scsi/scsi_device.h> #include <asm/semaphore.h> @@ -1045,8 +1046,9 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr) * more FIBs. */ -int aac_command_thread(struct aac_dev * dev) +int aac_command_thread(void *data) { + struct aac_dev *dev = data; struct hw_fib *hw_fib, *hw_newfib; struct fib *fib, *newfib; struct aac_fib_context *fibctx; @@ -1058,12 +1060,7 @@ int aac_command_thread(struct aac_dev * dev) */ if (dev->aif_thread) return -EINVAL; - /* - * Set up the name that will appear in 'ps' - * stored in task_struct.comm[16]. - */ - daemonize("aacraid"); - allow_signal(SIGKILL); + /* * Let the DPC know it has a place to send the AIF's to. */ @@ -1266,13 +1263,12 @@ int aac_command_thread(struct aac_dev * dev) spin_unlock_irqrestore(dev->queues->queue[HostNormCmdQueue].lock, flags); schedule(); - if(signal_pending(current)) + if (kthread_should_stop()) break; set_current_state(TASK_INTERRUPTIBLE); } if (dev->queues) remove_wait_queue(&dev->queues->queue[HostNormCmdQueue].cmdready, &wait); dev->aif_thread = 0; - complete_and_exit(&dev->aif_completion, 0); return 0; } |