Skip to content

Commit 6cdd552

Browse files
djbwJames Bottomley
authored andcommitted
[SCSI] queue async scan work to an async_schedule domain
This is preparation to enable async_synchronize_full() to be used as a replacement for scsi_complete_async_scans(), i.e. to stop leaking scsi internal details where they are not needed. Signed-off-by: Dan Williams <dan.j.williams@intel.com> Tested-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
1 parent a468348 commit 6cdd552

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

drivers/scsi/scsi_scan.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1845,14 +1845,13 @@ static void do_scsi_scan_host(struct Scsi_Host *shost)
18451845
}
18461846
}
18471847

1848-
static int do_scan_async(void *_data)
1848+
static void do_scan_async(void *_data, async_cookie_t c)
18491849
{
18501850
struct async_scan_data *data = _data;
18511851
struct Scsi_Host *shost = data->shost;
18521852

18531853
do_scsi_scan_host(shost);
18541854
scsi_finish_async_scan(data);
1855-
return 0;
18561855
}
18571856

18581857
/**
@@ -1861,7 +1860,6 @@ static int do_scan_async(void *_data)
18611860
**/
18621861
void scsi_scan_host(struct Scsi_Host *shost)
18631862
{
1864-
struct task_struct *p;
18651863
struct async_scan_data *data;
18661864

18671865
if (strncmp(scsi_scan_type, "none", 4) == 0)
@@ -1876,9 +1874,11 @@ void scsi_scan_host(struct Scsi_Host *shost)
18761874
return;
18771875
}
18781876

1879-
p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);
1880-
if (IS_ERR(p))
1881-
do_scan_async(data);
1877+
/* register with the async subsystem so wait_for_device_probe()
1878+
* will flush this work
1879+
*/
1880+
async_schedule(do_scan_async, data);
1881+
18821882
/* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */
18831883
}
18841884
EXPORT_SYMBOL(scsi_scan_host);

0 commit comments

Comments
 (0)