summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/device_handler/scsi_dh_alua.c
diff options
context:
space:
mode:
authorMoger, Babu <Babu.Moger@netapp.com>2012-03-27 20:56:08 +0000
committerJames Bottomley <JBottomley@Parallels.com>2012-04-23 19:28:13 +0100
commitdcd3a754b8c811441326d68574598fb3b4976ff4 (patch)
treebad1efd7f910d4f84760e733626b2edd84098822 /drivers/scsi/device_handler/scsi_dh_alua.c
parent4335d092a1f28e17c5bafa6170bbf9599ca29c6a (diff)
downloadlinux-dcd3a754b8c811441326d68574598fb3b4976ff4.tar.gz
linux-dcd3a754b8c811441326d68574598fb3b4976ff4.tar.bz2
linux-dcd3a754b8c811441326d68574598fb3b4976ff4.zip
[SCSI] scsi_dh_alua: Store the PREF bit from RTPG
PREF bit indicates preferred target port group for accessing a logical unit. This bit is used to optimize the STPG command handling. Signed-off-by: Babu Moger <babu.moger@netapp.com> Reviewed-by: Hannes Reinecke <hare@suse.de> Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/device_handler/scsi_dh_alua.c')
-rw-r--r--drivers/scsi/device_handler/scsi_dh_alua.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/scsi/device_handler/scsi_dh_alua.c b/drivers/scsi/device_handler/scsi_dh_alua.c
index 506206ae5755..4865a99d9c38 100644
--- a/drivers/scsi/device_handler/scsi_dh_alua.c
+++ b/drivers/scsi/device_handler/scsi_dh_alua.c
@@ -63,6 +63,7 @@ struct alua_dh_data {
int rel_port;
int tpgs;
int state;
+ int pref;
unsigned flags; /* used for optimizing STPG */
unsigned char inq[ALUA_INQUIRY_SIZE];
unsigned char *buff;
@@ -558,14 +559,16 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h)
for (k = 4, ucp = h->buff + 4; k < len; k += off, ucp += off) {
if (h->group_id == (ucp[2] << 8) + ucp[3]) {
h->state = ucp[0] & 0x0f;
+ h->pref = ucp[0] >> 7;
valid_states = ucp[1];
}
off = 8 + (ucp[7] * 4);
}
sdev_printk(KERN_INFO, sdev,
- "%s: port group %02x state %c supports %c%c%c%c%c%c%c\n",
+ "%s: port group %02x state %c %s supports %c%c%c%c%c%c%c\n",
ALUA_DH_NAME, h->group_id, print_alua_state(h->state),
+ h->pref ? "preferred" : "non-preferred",
valid_states&TPGS_SUPPORT_TRANSITION?'T':'t',
valid_states&TPGS_SUPPORT_OFFLINE?'O':'o',
valid_states&TPGS_SUPPORT_LBA_DEPENDENT?'L':'l',