scsi: aacraid: change wait_sem to a completion
The wait_sem member is used like a completion, so we should use the respective API. The behavior is unchanged. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de> Reviewed-by: Dave Carroll <david.carroll@microsemi.com> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
此提交包含在:
@@ -203,7 +203,7 @@ static int open_getadapter_fib(struct aac_dev * dev, void __user *arg)
|
||||
/*
|
||||
* Initialize the mutex used to wait for the next AIF.
|
||||
*/
|
||||
sema_init(&fibctx->wait_sem, 0);
|
||||
init_completion(&fibctx->completion);
|
||||
fibctx->wait = 0;
|
||||
/*
|
||||
* Initialize the fibs and set the count of fibs on
|
||||
@@ -335,7 +335,7 @@ return_fib:
|
||||
ssleep(1);
|
||||
}
|
||||
if (f.wait) {
|
||||
if(down_interruptible(&fibctx->wait_sem) < 0) {
|
||||
if (wait_for_completion_interruptible(&fibctx->completion) < 0) {
|
||||
status = -ERESTARTSYS;
|
||||
} else {
|
||||
/* Lock again and retry */
|
||||
|
新增問題並參考
封鎖使用者