[PATCH 3/3] scsi_dh_rdac : decide on whether to send mode select or not based on operating mode

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

 



Based on the operating modes, handler decides whether to send mode select or not. Purpose here is to reduce
io-shipping as much as possible whenever there is an option.

Signed-off-by: Babu Moger <babu.moger@xxxxxxx>
Reviewed-by: Yanling Qi <yanling.qi@xxxxxxx> 
Reviewed-by: Sudhir Dachepalli <Sudhir.Dachepalli@xxxxxxx>
Reviewed-by: Somasundaram Krishnasamy <Somasundaram.Krishnasamy@xxxxxxx>
Reviewed-by: Bob Stankey <Robert.Stankey@xxxxxxx>
Reviewed-by: Vijay Chauhan <Vijay.Chauhan@xxxxxxx>

---
--- linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c.orig	2011-03-17 16:57:51.000000000 -0500
+++ linux-2.6.38/drivers/scsi/device_handler/scsi_dh_rdac.c	2011-03-17 16:59:11.000000000 -0500
@@ -670,12 +670,27 @@ static int rdac_activate(struct scsi_dev
 {
 	struct rdac_dh_data *h = get_rdac_data(sdev);
 	int err = SCSI_DH_OK;
+	int act = 0;
 
 	err = check_ownership(sdev, h);
 	if (err != SCSI_DH_OK)
 		goto done;
 
-	if (h->lun_state == RDAC_LUN_UNOWNED) {
+	switch (h->mode) {
+	case RDAC_MODE:
+		if (h->lun_state == RDAC_LUN_UNOWNED)
+			act = 1;
+		break;
+	case RDAC_MODE_IOSHIP:
+		if ((h->lun_state == RDAC_LUN_UNOWNED) &&
+		    (h->preferred == RDAC_PREFERRED))
+			act = 1;
+		break;
+	default:
+		break;
+	}
+
+	if (act) {
 		err = queue_mode_select(sdev, fn, data);
 		if (err == SCSI_DH_OK)
 			return 0;


--
To unsubscribe from this list: 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