[SCSI] ipr: slave_alloc optimization

Optimize ipr's slave_alloc to return -ENXIO for devices that
do not exist.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
This commit is contained in:
brking@us.ibm.com 2005-11-01 17:01:07 -06:00 коммит произвёл James Bottomley
Родитель 0726ce2610
Коммит 692aebfc69
1 изменённых файлов: 4 добавлений и 2 удалений

Просмотреть файл

@ -2815,13 +2815,14 @@ static int ipr_slave_configure(struct scsi_device *sdev)
* handling new commands. * handling new commands.
* *
* Return value: * Return value:
* 0 on success * 0 on success / -ENXIO if device does not exist
**/ **/
static int ipr_slave_alloc(struct scsi_device *sdev) static int ipr_slave_alloc(struct scsi_device *sdev)
{ {
struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata; struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata;
struct ipr_resource_entry *res; struct ipr_resource_entry *res;
unsigned long lock_flags; unsigned long lock_flags;
int rc = -ENXIO;
sdev->hostdata = NULL; sdev->hostdata = NULL;
@ -2836,13 +2837,14 @@ static int ipr_slave_alloc(struct scsi_device *sdev)
res->in_erp = 0; res->in_erp = 0;
sdev->hostdata = res; sdev->hostdata = res;
res->needs_sync_complete = 1; res->needs_sync_complete = 1;
rc = 0;
break; break;
} }
} }
spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags); spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
return 0; return rc;
} }
/** /**