diff options
author | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-11-20 11:57:18 -0800 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-11-20 11:57:18 -0800 |
commit | d1fa7a1d506730a5d1211048c2fdacc42373d4d5 (patch) | |
tree | d3105e04c7134c5e1a982cad8e185c3ffce15d11 /drivers/target/iscsi/iscsi_target_tpg.c | |
parent | b0a382c58ef5c12804cda4268d7e62bef978789d (diff) | |
download | linux-d1fa7a1d506730a5d1211048c2fdacc42373d4d5.tar.gz linux-d1fa7a1d506730a5d1211048c2fdacc42373d4d5.tar.bz2 linux-d1fa7a1d506730a5d1211048c2fdacc42373d4d5.zip |
iscsi-target: Expose default_erl as TPG attribute
This patch exposes default_erl as a TPG attribute so that it may be
set TPG wide in demo-mode, but still allow the existing NodeACL
attribute to be overridden on a per initiator basis.
Reported-by: Arshad Hussain <arshad.hussain@calsoftinc.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target/iscsi/iscsi_target_tpg.c')
-rw-r--r-- | drivers/target/iscsi/iscsi_target_tpg.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/target/iscsi/iscsi_target_tpg.c b/drivers/target/iscsi/iscsi_target_tpg.c index 98ccf0bff546..39761837608d 100644 --- a/drivers/target/iscsi/iscsi_target_tpg.c +++ b/drivers/target/iscsi/iscsi_target_tpg.c @@ -224,6 +224,7 @@ static void iscsit_set_default_tpg_attribs(struct iscsi_portal_group *tpg) a->demo_mode_write_protect = TA_DEMO_MODE_WRITE_PROTECT; a->prod_mode_write_protect = TA_PROD_MODE_WRITE_PROTECT; a->demo_mode_discovery = TA_DEMO_MODE_DISCOVERY; + a->default_erl = TA_DEFAULT_ERL; } int iscsit_tpg_add_portal_group(struct iscsi_tiqn *tiqn, struct iscsi_portal_group *tpg) @@ -840,3 +841,20 @@ int iscsit_ta_demo_mode_discovery( return 0; } + +int iscsit_ta_default_erl( + struct iscsi_portal_group *tpg, + u32 default_erl) +{ + struct iscsi_tpg_attrib *a = &tpg->tpg_attrib; + + if ((default_erl != 0) && (default_erl != 1) && (default_erl != 2)) { + pr_err("Illegal value for default_erl: %u\n", default_erl); + return -EINVAL; + } + + a->default_erl = default_erl; + pr_debug("iSCSI_TPG[%hu] - DefaultERL: %u\n", tpg->tpgt, a->default_erl); + + return 0; +} |