aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/aacraid/commsup.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2006-02-14 12:45:06 -0500
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-02-27 23:55:14 -0500
commitfe27381d16c6683c55e618360d0d11bd43647e43 (patch)
tree142cd1c8661480081b293fe50de9354b0b181ffd /drivers/scsi/aacraid/commsup.c
parent38e14f895b212943995379dea824cc52b0c25991 (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.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/scsi/aacraid/commsup.c b/drivers/scsi/aacraid/commsup.c
index 609fd19b1844..c7f80ec7abde 100644
--- a/drivers/scsi/aacraid/commsup.c
+++ b/drivers/scsi/aacraid/commsup.c
@@ -39,6 +39,7 @@
39#include <linux/completion.h> 39#include <linux/completion.h>
40#include <linux/blkdev.h> 40#include <linux/blkdev.h>
41#include <linux/delay.h> 41#include <linux/delay.h>
42#include <linux/kthread.h>
42#include <scsi/scsi_host.h> 43#include <scsi/scsi_host.h>
43#include <scsi/scsi_device.h> 44#include <scsi/scsi_device.h>
44#include <asm/semaphore.h> 45#include <asm/semaphore.h>
@@ -1045,8 +1046,9 @@ static void aac_handle_aif(struct aac_dev * dev, struct fib * fibptr)
1045 * more FIBs. 1046 * more FIBs.
1046 */ 1047 */
1047 1048
1048int aac_command_thread(struct aac_dev * dev) 1049int aac_command_thread(void *data)
1049{ 1050{
1051 struct aac_dev *dev = data;
1050 struct hw_fib *hw_fib, *hw_newfib; 1052 struct hw_fib *hw_fib, *hw_newfib;
1051 struct fib *fib, *newfib; 1053 struct fib *fib, *newfib;
1052 struct aac_fib_context *fibctx; 1054 struct aac_fib_context *fibctx;
@@ -1058,12 +1060,7 @@ int aac_command_thread(struct aac_dev * dev)
1058 */ 1060 */
1059 if (dev->aif_thread) 1061 if (dev->aif_thread)
1060 return -EINVAL; 1062 return -EINVAL;
1061 /* 1063
1062 * Set up the name that will appear in 'ps'
1063 * stored in task_struct.comm[16].
1064 */
1065 daemonize("aacraid");
1066 allow_signal(SIGKILL);
1067 /* 1064 /*
1068 * Let the DPC know it has a place to send the AIF's to. 1065 * Let the DPC know it has a place to send the AIF's to.
1069 */ 1066 */
@@ -1266,13 +1263,12 @@ int aac_command_thread(struct aac_dev * dev)
1266 spin_unlock_irqrestore(dev->queues->queue[HostNormCmdQueue].lock, flags); 1263 spin_unlock_irqrestore(dev->queues->queue[HostNormCmdQueue].lock, flags);
1267 schedule(); 1264 schedule();
1268 1265
1269 if(signal_pending(current)) 1266 if (kthread_should_stop())
1270 break; 1267 break;
1271 set_current_state(TASK_INTERRUPTIBLE); 1268 set_current_state(TASK_INTERRUPTIBLE);
1272 } 1269 }
1273 if (dev->queues) 1270 if (dev->queues)
1274 remove_wait_queue(&dev->queues->queue[HostNormCmdQueue].cmdready, &wait); 1271 remove_wait_queue(&dev->queues->queue[HostNormCmdQueue].cmdready, &wait);
1275 dev->aif_thread = 0; 1272 dev->aif_thread = 0;
1276 complete_and_exit(&dev->aif_completion, 0);
1277 return 0; 1273 return 0;
1278} 1274}