diff options
author | Vikas Chaudhary <vikas.chaudhary@qlogic.com> | 2012-01-19 06:06:53 -0500 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-02-19 09:08:54 -0500 |
commit | 3c5c48011809045881d30e197577ef1dca9a3e72 (patch) | |
tree | 82298a961ddafede28cffe5c3664101be70d90f6 /drivers | |
parent | 331954cfd89890b246ee2d0acd911593b987f603 (diff) |
[SCSI] libiscsi: Added support to show targetalias in sysfs
sysfs patch to view target alias:
/sys/class/iscsi_session/session*/targetalias
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/libiscsi.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/scsi/libiscsi.c b/drivers/scsi/libiscsi.c index 143bbe448bec..00592e3bb375 100644 --- a/drivers/scsi/libiscsi.c +++ b/drivers/scsi/libiscsi.c | |||
@@ -2807,6 +2807,7 @@ void iscsi_session_teardown(struct iscsi_cls_session *cls_session) | |||
2807 | kfree(session->username); | 2807 | kfree(session->username); |
2808 | kfree(session->username_in); | 2808 | kfree(session->username_in); |
2809 | kfree(session->targetname); | 2809 | kfree(session->targetname); |
2810 | kfree(session->targetalias); | ||
2810 | kfree(session->initiatorname); | 2811 | kfree(session->initiatorname); |
2811 | kfree(session->ifacename); | 2812 | kfree(session->ifacename); |
2812 | 2813 | ||
@@ -3233,6 +3234,8 @@ int iscsi_set_param(struct iscsi_cls_conn *cls_conn, | |||
3233 | return iscsi_switch_str_param(&session->password_in, buf); | 3234 | return iscsi_switch_str_param(&session->password_in, buf); |
3234 | case ISCSI_PARAM_TARGET_NAME: | 3235 | case ISCSI_PARAM_TARGET_NAME: |
3235 | return iscsi_switch_str_param(&session->targetname, buf); | 3236 | return iscsi_switch_str_param(&session->targetname, buf); |
3237 | case ISCSI_PARAM_TARGET_ALIAS: | ||
3238 | return iscsi_switch_str_param(&session->targetalias, buf); | ||
3236 | case ISCSI_PARAM_TPGT: | 3239 | case ISCSI_PARAM_TPGT: |
3237 | sscanf(buf, "%d", &session->tpgt); | 3240 | sscanf(buf, "%d", &session->tpgt); |
3238 | break; | 3241 | break; |
@@ -3299,6 +3302,9 @@ int iscsi_session_get_param(struct iscsi_cls_session *cls_session, | |||
3299 | case ISCSI_PARAM_TARGET_NAME: | 3302 | case ISCSI_PARAM_TARGET_NAME: |
3300 | len = sprintf(buf, "%s\n", session->targetname); | 3303 | len = sprintf(buf, "%s\n", session->targetname); |
3301 | break; | 3304 | break; |
3305 | case ISCSI_PARAM_TARGET_ALIAS: | ||
3306 | len = sprintf(buf, "%s\n", session->targetalias); | ||
3307 | break; | ||
3302 | case ISCSI_PARAM_TPGT: | 3308 | case ISCSI_PARAM_TPGT: |
3303 | len = sprintf(buf, "%d\n", session->tpgt); | 3309 | len = sprintf(buf, "%d\n", session->tpgt); |
3304 | break; | 3310 | break; |