提交 6cdd5520 编写于 作者: D Dan Williams 提交者: James Bottomley

[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: NDan Williams <dan.j.williams@intel.com>
Tested-by: NEldad Zack <eldad@fogrefinery.com>
Signed-off-by: NJames Bottomley <JBottomley@Parallels.com>
上级 a4683487
...@@ -1845,14 +1845,13 @@ static void do_scsi_scan_host(struct Scsi_Host *shost) ...@@ -1845,14 +1845,13 @@ static void do_scsi_scan_host(struct Scsi_Host *shost)
} }
} }
static int do_scan_async(void *_data) static void do_scan_async(void *_data, async_cookie_t c)
{ {
struct async_scan_data *data = _data; struct async_scan_data *data = _data;
struct Scsi_Host *shost = data->shost; struct Scsi_Host *shost = data->shost;
do_scsi_scan_host(shost); do_scsi_scan_host(shost);
scsi_finish_async_scan(data); scsi_finish_async_scan(data);
return 0;
} }
/** /**
...@@ -1861,7 +1860,6 @@ static int do_scan_async(void *_data) ...@@ -1861,7 +1860,6 @@ static int do_scan_async(void *_data)
**/ **/
void scsi_scan_host(struct Scsi_Host *shost) void scsi_scan_host(struct Scsi_Host *shost)
{ {
struct task_struct *p;
struct async_scan_data *data; struct async_scan_data *data;
if (strncmp(scsi_scan_type, "none", 4) == 0) if (strncmp(scsi_scan_type, "none", 4) == 0)
...@@ -1876,9 +1874,11 @@ void scsi_scan_host(struct Scsi_Host *shost) ...@@ -1876,9 +1874,11 @@ void scsi_scan_host(struct Scsi_Host *shost)
return; return;
} }
p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no); /* register with the async subsystem so wait_for_device_probe()
if (IS_ERR(p)) * will flush this work
do_scan_async(data); */
async_schedule(do_scan_async, data);
/* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */ /* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */
} }
EXPORT_SYMBOL(scsi_scan_host); EXPORT_SYMBOL(scsi_scan_host);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册