diff mbox

[PATCHv3,16/24] scsi_dh_alua: Add new blacklist flag 'BLIST_SYNC_ALUA'

Message ID 1452672599-9820-17-git-send-email-hare@suse.de (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Hannes Reinecke Jan. 13, 2016, 8:09 a.m. UTC
Add a new blacklist flag BLIST_SYNC_ALUA to instruct the
alua device handler to use synchronous command submission
for ALUA commands.

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/device_handler/scsi_dh_alua.c | 7 +++++++
 include/scsi/scsi_devinfo.h                | 1 +
 2 files changed, 8 insertions(+)

Comments

Christoph Hellwig Jan. 18, 2016, 5:50 p.m. UTC | #1
> @@ -335,6 +336,10 @@ static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h,
>  	int rel_port = -1, group_id;
>  	struct alua_port_group *pg, *old_pg = NULL;
>  	bool pg_updated = false;
> +	unsigned int bflags = scsi_get_device_flags_keyed(sdev,
> +							  &sdev->inquiry[8],
> +							  &sdev->inquiry[16],
> +							  SCSI_DEVINFO_GLOBAL);

I see not reason to use scsi_get_device_flags_keyed over
scsi_get_device_flags here.  Also:

 - why can't we just set a flag in the sdev like for most other
   blacklist item (in the long run I plan to simply mirror all blist
   flags into the sdev anyway).
 - please add the affected arrays to scsi_static_device_list
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 36c515c..f0687ba 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -27,6 +27,7 @@ 
 #include <scsi/scsi_dbg.h>
 #include <scsi/scsi_eh.h>
 #include <scsi/scsi_dh.h>
+#include <scsi/scsi_devinfo.h>
 
 #define ALUA_DH_NAME "alua"
 #define ALUA_DH_VER "1.3"
@@ -335,6 +336,10 @@  static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h,
 	int rel_port = -1, group_id;
 	struct alua_port_group *pg, *old_pg = NULL;
 	bool pg_updated = false;
+	unsigned int bflags = scsi_get_device_flags_keyed(sdev,
+							  &sdev->inquiry[8],
+							  &sdev->inquiry[16],
+							  SCSI_DEVINFO_GLOBAL);
 
 	group_id = scsi_vpd_tpg_id(sdev, &rel_port);
 	if (group_id < 0) {
@@ -373,6 +378,8 @@  static int alua_check_vpd(struct scsi_device *sdev, struct alua_dh_data *h,
 		rcu_assign_pointer(h->pg, pg);
 		pg_updated = true;
 	}
+	if (bflags & BLIST_SYNC_ALUA)
+		pg->flags |= ALUA_SYNC_STPG;
 	alua_rtpg_queue(h->pg, sdev, NULL);
 	spin_unlock(&h->pg_lock);
 
diff --git a/include/scsi/scsi_devinfo.h b/include/scsi/scsi_devinfo.h
index aca3c80..dc0cb5f 100644
--- a/include/scsi/scsi_devinfo.h
+++ b/include/scsi/scsi_devinfo.h
@@ -37,6 +37,7 @@ 
 #define BLIST_TRY_VPD_PAGES	0x10000000 /* Attempt to read VPD pages */
 #define BLIST_NO_RSOC		0x20000000 /* don't try to issue RSOC */
 #define BLIST_MAX_1024		0x40000000 /* maximum 1024 sector cdb length */
+#define BLIST_SYNC_ALUA		0x80000000 /* Synchronous ALUA commands */
 
 /* list of keys for the lists */
 enum {