[SCSI] host state model update: mediate host add/remove race

Add support to not allow additions to a host when it is being removed.

Signed-off-by: Mike Anderson <andmike@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
Mike Anderson
2005-06-16 11:14:33 -07:00
committed by James Bottomley
parent d2c9d9eafa
commit 82f29467a0
3 changed files with 25 additions and 7 deletions

View File

@@ -133,7 +133,9 @@ EXPORT_SYMBOL(scsi_host_set_state);
**/
void scsi_remove_host(struct Scsi_Host *shost)
{
down(&shost->scan_mutex);
scsi_host_set_state(shost, SHOST_CANCEL);
up(&shost->scan_mutex);
scsi_forget_host(shost);
scsi_proc_host_rm(shost);