diff options
author | Moger, Babu <Babu.Moger@netapp.com> | 2012-03-27 16:56:08 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-04-23 14:28:13 -0400 |
commit | dcd3a754b8c811441326d68574598fb3b4976ff4 (patch) | |
tree | bad1efd7f910d4f84760e733626b2edd84098822 /drivers/scsi/device_handler | |
parent | 4335d092a1f28e17c5bafa6170bbf9599ca29c6a (diff) |
[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')
-rw-r--r-- | drivers/scsi/device_handler/scsi_dh_alua.c | 5 |
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 { | |||
63 | int rel_port; | 63 | int rel_port; |
64 | int tpgs; | 64 | int tpgs; |
65 | int state; | 65 | int state; |
66 | int pref; | ||
66 | unsigned flags; /* used for optimizing STPG */ | 67 | unsigned flags; /* used for optimizing STPG */ |
67 | unsigned char inq[ALUA_INQUIRY_SIZE]; | 68 | unsigned char inq[ALUA_INQUIRY_SIZE]; |
68 | unsigned char *buff; | 69 | unsigned char *buff; |
@@ -558,14 +559,16 @@ static int alua_rtpg(struct scsi_device *sdev, struct alua_dh_data *h) | |||
558 | for (k = 4, ucp = h->buff + 4; k < len; k += off, ucp += off) { | 559 | for (k = 4, ucp = h->buff + 4; k < len; k += off, ucp += off) { |
559 | if (h->group_id == (ucp[2] << 8) + ucp[3]) { | 560 | if (h->group_id == (ucp[2] << 8) + ucp[3]) { |
560 | h->state = ucp[0] & 0x0f; | 561 | h->state = ucp[0] & 0x0f; |
562 | h->pref = ucp[0] >> 7; | ||
561 | valid_states = ucp[1]; | 563 | valid_states = ucp[1]; |
562 | } | 564 | } |
563 | off = 8 + (ucp[7] * 4); | 565 | off = 8 + (ucp[7] * 4); |
564 | } | 566 | } |
565 | 567 | ||
566 | sdev_printk(KERN_INFO, sdev, | 568 | sdev_printk(KERN_INFO, sdev, |
567 | "%s: port group %02x state %c supports %c%c%c%c%c%c%c\n", | 569 | "%s: port group %02x state %c %s supports %c%c%c%c%c%c%c\n", |
568 | ALUA_DH_NAME, h->group_id, print_alua_state(h->state), | 570 | ALUA_DH_NAME, h->group_id, print_alua_state(h->state), |
571 | h->pref ? "preferred" : "non-preferred", | ||
569 | valid_states&TPGS_SUPPORT_TRANSITION?'T':'t', | 572 | valid_states&TPGS_SUPPORT_TRANSITION?'T':'t', |
570 | valid_states&TPGS_SUPPORT_OFFLINE?'O':'o', | 573 | valid_states&TPGS_SUPPORT_OFFLINE?'O':'o', |
571 | valid_states&TPGS_SUPPORT_LBA_DEPENDENT?'L':'l', | 574 | valid_states&TPGS_SUPPORT_LBA_DEPENDENT?'L':'l', |