[PATCH 09/26] ipr: slave_alloc optimization

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

Signed-off-by: Brian King <brking@xxxxxxxxxx>
---

 drivers/scsi/ipr.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff -puN drivers/scsi/ipr.c~ipr_slave_alloc_optimization drivers/scsi/ipr.c
--- linux-2.6/drivers/scsi/ipr.c~ipr_slave_alloc_optimization	2005-10-31 21:53:05.562942664 -0600
+++ linux-2.6-bjking1/drivers/scsi/ipr.c	2005-10-31 21:53:05.618934152 -0600
@@ -2815,13 +2815,14 @@ static int ipr_slave_configure(struct sc
  * handling new commands.
  *
  * Return value:
- * 	0 on success
+ * 	0 on success / -ENXIO if device does not exist
  **/
 static int ipr_slave_alloc(struct scsi_device *sdev)
 {
 	struct ipr_ioa_cfg *ioa_cfg = (struct ipr_ioa_cfg *) sdev->host->hostdata;
 	struct ipr_resource_entry *res;
 	unsigned long lock_flags;
+	int rc = -ENXIO;
 
 	sdev->hostdata = NULL;
 
@@ -2836,13 +2837,14 @@ static int ipr_slave_alloc(struct scsi_d
 			res->in_erp = 0;
 			sdev->hostdata = res;
 			res->needs_sync_complete = 1;
+			rc = 0;
 			break;
 		}
 	}
 
 	spin_unlock_irqrestore(ioa_cfg->host->host_lock, lock_flags);
 
-	return 0;
+	return rc;
 }
 
 /**
_
-
: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux