aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/target/target_core_configfs.c
diff options
context:
space:
mode:
authorNicholas Bellinger <nab@linux-iscsi.org>2012-05-17 01:02:34 -0400
committerNicholas Bellinger <nab@linux-iscsi.org>2012-05-17 03:45:58 -0400
commit5b9a4d7280e160982a8ea37bc03619f53b5c98b7 (patch)
tree3d7fbce10e7379097f34276b6a8a7d090d4dc813 /drivers/target/target_core_configfs.c
parentba539743b70cd160c84bab1c82910d0789b820f8 (diff)
target: Add MI_REPORT_TARGET_PGS ext. header + implict_trans_secs attribute
This patch adds support for ALUA MI_REPORT_TARGET_PGS extended header format defined within SPC-4. It changes target core ALUA emulation logic within target_emulate_report_target_port_groups() to support both the extended and original length only header formats. It includes adding a new 'implict_trans_secs' attribute for each ALUA target port group to control the value returned to the application client for an recommended implict translation timeout in seconds. By default this value is currently set to zero, and limited up to 255 by virtue of using a single byte in the extended header format. This value is used by target_emulate_report_target_port_groups() within the extended header logic to set IMPLICIT TRANSITION TIME as defined by spc4r30. Cc: Hannes Reinecke <hare@suse.de> Cc: Rob Evers <revers@redhat.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Roland Dreier <roland@purestorage.com> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/target_core_configfs.c')
-rw-r--r--drivers/target/target_core_configfs.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/target/target_core_configfs.c b/drivers/target/target_core_configfs.c
index 931521cc4e4f..801efa892046 100644
--- a/drivers/target/target_core_configfs.c
+++ b/drivers/target/target_core_configfs.c
@@ -2447,6 +2447,26 @@ static ssize_t target_core_alua_tg_pt_gp_store_attr_trans_delay_msecs(
2447SE_DEV_ALUA_TG_PT_ATTR(trans_delay_msecs, S_IRUGO | S_IWUSR); 2447SE_DEV_ALUA_TG_PT_ATTR(trans_delay_msecs, S_IRUGO | S_IWUSR);
2448 2448
2449/* 2449/*
2450 * implict_trans_secs
2451 */
2452static ssize_t target_core_alua_tg_pt_gp_show_attr_implict_trans_secs(
2453 struct t10_alua_tg_pt_gp *tg_pt_gp,
2454 char *page)
2455{
2456 return core_alua_show_implict_trans_secs(tg_pt_gp, page);
2457}
2458
2459static ssize_t target_core_alua_tg_pt_gp_store_attr_implict_trans_secs(
2460 struct t10_alua_tg_pt_gp *tg_pt_gp,
2461 const char *page,
2462 size_t count)
2463{
2464 return core_alua_store_implict_trans_secs(tg_pt_gp, page, count);
2465}
2466
2467SE_DEV_ALUA_TG_PT_ATTR(implict_trans_secs, S_IRUGO | S_IWUSR);
2468
2469/*
2450 * preferred 2470 * preferred
2451 */ 2471 */
2452 2472
@@ -2570,6 +2590,7 @@ static struct configfs_attribute *target_core_alua_tg_pt_gp_attrs[] = {
2570 &target_core_alua_tg_pt_gp_alua_write_metadata.attr, 2590 &target_core_alua_tg_pt_gp_alua_write_metadata.attr,
2571 &target_core_alua_tg_pt_gp_nonop_delay_msecs.attr, 2591 &target_core_alua_tg_pt_gp_nonop_delay_msecs.attr,
2572 &target_core_alua_tg_pt_gp_trans_delay_msecs.attr, 2592 &target_core_alua_tg_pt_gp_trans_delay_msecs.attr,
2593 &target_core_alua_tg_pt_gp_implict_trans_secs.attr,
2573 &target_core_alua_tg_pt_gp_preferred.attr, 2594 &target_core_alua_tg_pt_gp_preferred.attr,
2574 &target_core_alua_tg_pt_gp_tg_pt_gp_id.attr, 2595 &target_core_alua_tg_pt_gp_tg_pt_gp_id.attr,
2575 &target_core_alua_tg_pt_gp_members.attr, 2596 &target_core_alua_tg_pt_gp_members.attr,