diff options
author | Andy Grover <agrover@redhat.com> | 2013-10-09 14:05:58 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2013-10-16 16:38:18 -0400 |
commit | 60bfcf8e04184b8cd68607cabdf1adc142aa78d1 (patch) | |
tree | e256979bef615998d2012fb19fcd62354b3d1a73 /drivers/target | |
parent | b7eec2cdd874ad678228a32a31dea32e3fcc2f99 (diff) |
target/iscsi: Remove macros that contain typecasts
These just want to return a pointer instead of a value, but are otherwise
the same.
ISCSI_TPG_LUN macro was unused.
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Andy Grover <agrover@redhat.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
Diffstat (limited to 'drivers/target')
-rw-r--r-- | drivers/target/iscsi/iscsi_target.c | 2 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_auth.c | 2 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_core.h | 4 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_erl0.c | 10 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_login.c | 16 | ||||
-rw-r--r-- | drivers/target/iscsi/iscsi_target_nego.c | 6 |
6 files changed, 18 insertions, 22 deletions
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c index 35b61f7d6c63..934b5b9b7cf6 100644 --- a/drivers/target/iscsi/iscsi_target.c +++ b/drivers/target/iscsi/iscsi_target.c | |||
@@ -4376,7 +4376,7 @@ int iscsit_close_connection( | |||
4376 | 4376 | ||
4377 | int iscsit_close_session(struct iscsi_session *sess) | 4377 | int iscsit_close_session(struct iscsi_session *sess) |
4378 | { | 4378 | { |
4379 | struct iscsi_portal_group *tpg = ISCSI_TPG_S(sess); | 4379 | struct iscsi_portal_group *tpg = sess->tpg; |
4380 | struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; | 4380 | struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; |
4381 | 4381 | ||
4382 | if (atomic_read(&sess->nconn)) { | 4382 | if (atomic_read(&sess->nconn)) { |
diff --git a/drivers/target/iscsi/iscsi_target_auth.c b/drivers/target/iscsi/iscsi_target_auth.c index 7505fddca15f..164b87138faf 100644 --- a/drivers/target/iscsi/iscsi_target_auth.c +++ b/drivers/target/iscsi/iscsi_target_auth.c | |||
@@ -111,7 +111,7 @@ static struct iscsi_chap *chap_server_open( | |||
111 | /* | 111 | /* |
112 | * Set Identifier. | 112 | * Set Identifier. |
113 | */ | 113 | */ |
114 | chap->id = ISCSI_TPG_C(conn)->tpg_chap_id++; | 114 | chap->id = conn->tpg->tpg_chap_id++; |
115 | *aic_len += sprintf(aic_str + *aic_len, "CHAP_I=%d", chap->id); | 115 | *aic_len += sprintf(aic_str + *aic_len, "CHAP_I=%d", chap->id); |
116 | *aic_len += 1; | 116 | *aic_len += 1; |
117 | pr_debug("[server] Sending CHAP_I=%d\n", chap->id); | 117 | pr_debug("[server] Sending CHAP_I=%d\n", chap->id); |
diff --git a/drivers/target/iscsi/iscsi_target_core.h b/drivers/target/iscsi/iscsi_target_core.h index 1d14f77aec2e..cf8a1921a392 100644 --- a/drivers/target/iscsi/iscsi_target_core.h +++ b/drivers/target/iscsi/iscsi_target_core.h | |||
@@ -830,10 +830,6 @@ struct iscsi_portal_group { | |||
830 | struct list_head tpg_list; | 830 | struct list_head tpg_list; |
831 | } ____cacheline_aligned; | 831 | } ____cacheline_aligned; |
832 | 832 | ||
833 | #define ISCSI_TPG_C(c) ((struct iscsi_portal_group *)(c)->tpg) | ||
834 | #define ISCSI_TPG_LUN(c, l) ((iscsi_tpg_list_t *)(c)->tpg->tpg_lun_list_t[l]) | ||
835 | #define ISCSI_TPG_S(s) ((struct iscsi_portal_group *)(s)->tpg) | ||
836 | |||
837 | struct iscsi_wwn_stat_grps { | 833 | struct iscsi_wwn_stat_grps { |
838 | struct config_group iscsi_stat_group; | 834 | struct config_group iscsi_stat_group; |
839 | struct config_group iscsi_instance_group; | 835 | struct config_group iscsi_instance_group; |
diff --git a/drivers/target/iscsi/iscsi_target_erl0.c b/drivers/target/iscsi/iscsi_target_erl0.c index 41052e512d92..cbea7f16d625 100644 --- a/drivers/target/iscsi/iscsi_target_erl0.c +++ b/drivers/target/iscsi/iscsi_target_erl0.c | |||
@@ -757,7 +757,7 @@ int iscsit_check_post_dataout( | |||
757 | static void iscsit_handle_time2retain_timeout(unsigned long data) | 757 | static void iscsit_handle_time2retain_timeout(unsigned long data) |
758 | { | 758 | { |
759 | struct iscsi_session *sess = (struct iscsi_session *) data; | 759 | struct iscsi_session *sess = (struct iscsi_session *) data; |
760 | struct iscsi_portal_group *tpg = ISCSI_TPG_S(sess); | 760 | struct iscsi_portal_group *tpg = sess->tpg; |
761 | struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; | 761 | struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; |
762 | 762 | ||
763 | spin_lock_bh(&se_tpg->session_lock); | 763 | spin_lock_bh(&se_tpg->session_lock); |
@@ -801,9 +801,9 @@ void iscsit_start_time2retain_handler(struct iscsi_session *sess) | |||
801 | * Only start Time2Retain timer when the associated TPG is still in | 801 | * Only start Time2Retain timer when the associated TPG is still in |
802 | * an ACTIVE (eg: not disabled or shutdown) state. | 802 | * an ACTIVE (eg: not disabled or shutdown) state. |
803 | */ | 803 | */ |
804 | spin_lock(&ISCSI_TPG_S(sess)->tpg_state_lock); | 804 | spin_lock(&sess->tpg->tpg_state_lock); |
805 | tpg_active = (ISCSI_TPG_S(sess)->tpg_state == TPG_STATE_ACTIVE); | 805 | tpg_active = (sess->tpg->tpg_state == TPG_STATE_ACTIVE); |
806 | spin_unlock(&ISCSI_TPG_S(sess)->tpg_state_lock); | 806 | spin_unlock(&sess->tpg->tpg_state_lock); |
807 | 807 | ||
808 | if (!tpg_active) | 808 | if (!tpg_active) |
809 | return; | 809 | return; |
@@ -829,7 +829,7 @@ void iscsit_start_time2retain_handler(struct iscsi_session *sess) | |||
829 | */ | 829 | */ |
830 | int iscsit_stop_time2retain_timer(struct iscsi_session *sess) | 830 | int iscsit_stop_time2retain_timer(struct iscsi_session *sess) |
831 | { | 831 | { |
832 | struct iscsi_portal_group *tpg = ISCSI_TPG_S(sess); | 832 | struct iscsi_portal_group *tpg = sess->tpg; |
833 | struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; | 833 | struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; |
834 | 834 | ||
835 | if (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED) | 835 | if (sess->time2retain_timer_flags & ISCSI_TF_EXPIRED) |
diff --git a/drivers/target/iscsi/iscsi_target_login.c b/drivers/target/iscsi/iscsi_target_login.c index 1794c753954a..646632aa2002 100644 --- a/drivers/target/iscsi/iscsi_target_login.c +++ b/drivers/target/iscsi/iscsi_target_login.c | |||
@@ -347,15 +347,15 @@ static int iscsi_login_zero_tsih_s2( | |||
347 | * Assign a new TPG Session Handle. Note this is protected with | 347 | * Assign a new TPG Session Handle. Note this is protected with |
348 | * struct iscsi_portal_group->np_login_sem from iscsit_access_np(). | 348 | * struct iscsi_portal_group->np_login_sem from iscsit_access_np(). |
349 | */ | 349 | */ |
350 | sess->tsih = ++ISCSI_TPG_S(sess)->ntsih; | 350 | sess->tsih = ++sess->tpg->ntsih; |
351 | if (!sess->tsih) | 351 | if (!sess->tsih) |
352 | sess->tsih = ++ISCSI_TPG_S(sess)->ntsih; | 352 | sess->tsih = ++sess->tpg->ntsih; |
353 | 353 | ||
354 | /* | 354 | /* |
355 | * Create the default params from user defined values.. | 355 | * Create the default params from user defined values.. |
356 | */ | 356 | */ |
357 | if (iscsi_copy_param_list(&conn->param_list, | 357 | if (iscsi_copy_param_list(&conn->param_list, |
358 | ISCSI_TPG_C(conn)->param_list, 1) < 0) { | 358 | conn->tpg->param_list, 1) < 0) { |
359 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, | 359 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, |
360 | ISCSI_LOGIN_STATUS_NO_RESOURCES); | 360 | ISCSI_LOGIN_STATUS_NO_RESOURCES); |
361 | return -1; | 361 | return -1; |
@@ -380,7 +380,7 @@ static int iscsi_login_zero_tsih_s2( | |||
380 | * In our case, we have already located the struct iscsi_tiqn at this point. | 380 | * In our case, we have already located the struct iscsi_tiqn at this point. |
381 | */ | 381 | */ |
382 | memset(buf, 0, 32); | 382 | memset(buf, 0, 32); |
383 | sprintf(buf, "TargetPortalGroupTag=%hu", ISCSI_TPG_S(sess)->tpgt); | 383 | sprintf(buf, "TargetPortalGroupTag=%hu", sess->tpg->tpgt); |
384 | if (iscsi_change_param_value(buf, conn->param_list, 0) < 0) { | 384 | if (iscsi_change_param_value(buf, conn->param_list, 0) < 0) { |
385 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, | 385 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, |
386 | ISCSI_LOGIN_STATUS_NO_RESOURCES); | 386 | ISCSI_LOGIN_STATUS_NO_RESOURCES); |
@@ -575,7 +575,7 @@ static int iscsi_login_non_zero_tsih_s2( | |||
575 | iscsi_login_set_conn_values(sess, conn, pdu->cid); | 575 | iscsi_login_set_conn_values(sess, conn, pdu->cid); |
576 | 576 | ||
577 | if (iscsi_copy_param_list(&conn->param_list, | 577 | if (iscsi_copy_param_list(&conn->param_list, |
578 | ISCSI_TPG_C(conn)->param_list, 0) < 0) { | 578 | conn->tpg->param_list, 0) < 0) { |
579 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, | 579 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, |
580 | ISCSI_LOGIN_STATUS_NO_RESOURCES); | 580 | ISCSI_LOGIN_STATUS_NO_RESOURCES); |
581 | return -1; | 581 | return -1; |
@@ -593,7 +593,7 @@ static int iscsi_login_non_zero_tsih_s2( | |||
593 | * In our case, we have already located the struct iscsi_tiqn at this point. | 593 | * In our case, we have already located the struct iscsi_tiqn at this point. |
594 | */ | 594 | */ |
595 | memset(buf, 0, 32); | 595 | memset(buf, 0, 32); |
596 | sprintf(buf, "TargetPortalGroupTag=%hu", ISCSI_TPG_S(sess)->tpgt); | 596 | sprintf(buf, "TargetPortalGroupTag=%hu", sess->tpg->tpgt); |
597 | if (iscsi_change_param_value(buf, conn->param_list, 0) < 0) { | 597 | if (iscsi_change_param_value(buf, conn->param_list, 0) < 0) { |
598 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, | 598 | iscsit_tx_login_rsp(conn, ISCSI_STATUS_CLS_TARGET_ERR, |
599 | ISCSI_LOGIN_STATUS_NO_RESOURCES); | 599 | ISCSI_LOGIN_STATUS_NO_RESOURCES); |
@@ -691,7 +691,7 @@ int iscsi_post_login_handler( | |||
691 | int stop_timer = 0; | 691 | int stop_timer = 0; |
692 | struct iscsi_session *sess = conn->sess; | 692 | struct iscsi_session *sess = conn->sess; |
693 | struct se_session *se_sess = sess->se_sess; | 693 | struct se_session *se_sess = sess->se_sess; |
694 | struct iscsi_portal_group *tpg = ISCSI_TPG_S(sess); | 694 | struct iscsi_portal_group *tpg = sess->tpg; |
695 | struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; | 695 | struct se_portal_group *se_tpg = &tpg->tpg_se_tpg; |
696 | struct iscsi_thread_set *ts; | 696 | struct iscsi_thread_set *ts; |
697 | 697 | ||
@@ -1154,7 +1154,7 @@ old_sess_out: | |||
1154 | spin_lock_bh(&conn->sess->conn_lock); | 1154 | spin_lock_bh(&conn->sess->conn_lock); |
1155 | if (conn->sess->session_state == TARG_SESS_STATE_FAILED) { | 1155 | if (conn->sess->session_state == TARG_SESS_STATE_FAILED) { |
1156 | struct se_portal_group *se_tpg = | 1156 | struct se_portal_group *se_tpg = |
1157 | &ISCSI_TPG_C(conn)->tpg_se_tpg; | 1157 | &conn->tpg->tpg_se_tpg; |
1158 | 1158 | ||
1159 | atomic_set(&conn->sess->session_continuation, 0); | 1159 | atomic_set(&conn->sess->session_continuation, 0); |
1160 | spin_unlock_bh(&conn->sess->conn_lock); | 1160 | spin_unlock_bh(&conn->sess->conn_lock); |
diff --git a/drivers/target/iscsi/iscsi_target_nego.c b/drivers/target/iscsi/iscsi_target_nego.c index 973a27f68a68..21265c9c12b5 100644 --- a/drivers/target/iscsi/iscsi_target_nego.c +++ b/drivers/target/iscsi/iscsi_target_nego.c | |||
@@ -789,7 +789,7 @@ static int iscsi_target_handle_csg_zero( | |||
789 | return -1; | 789 | return -1; |
790 | 790 | ||
791 | if (!iscsi_check_negotiated_keys(conn->param_list)) { | 791 | if (!iscsi_check_negotiated_keys(conn->param_list)) { |
792 | if (ISCSI_TPG_C(conn)->tpg_attrib.authentication && | 792 | if (conn->tpg->tpg_attrib.authentication && |
793 | !strncmp(param->value, NONE, 4)) { | 793 | !strncmp(param->value, NONE, 4)) { |
794 | pr_err("Initiator sent AuthMethod=None but" | 794 | pr_err("Initiator sent AuthMethod=None but" |
795 | " Target is enforcing iSCSI Authentication," | 795 | " Target is enforcing iSCSI Authentication," |
@@ -799,7 +799,7 @@ static int iscsi_target_handle_csg_zero( | |||
799 | return -1; | 799 | return -1; |
800 | } | 800 | } |
801 | 801 | ||
802 | if (ISCSI_TPG_C(conn)->tpg_attrib.authentication && | 802 | if (conn->tpg->tpg_attrib.authentication && |
803 | !login->auth_complete) | 803 | !login->auth_complete) |
804 | return 0; | 804 | return 0; |
805 | 805 | ||
@@ -862,7 +862,7 @@ static int iscsi_target_handle_csg_one(struct iscsi_conn *conn, struct iscsi_log | |||
862 | } | 862 | } |
863 | 863 | ||
864 | if (!login->auth_complete && | 864 | if (!login->auth_complete && |
865 | ISCSI_TPG_C(conn)->tpg_attrib.authentication) { | 865 | conn->tpg->tpg_attrib.authentication) { |
866 | pr_err("Initiator is requesting CSG: 1, has not been" | 866 | pr_err("Initiator is requesting CSG: 1, has not been" |
867 | " successfully authenticated, and the Target is" | 867 | " successfully authenticated, and the Target is" |
868 | " enforcing iSCSI Authentication, login failed.\n"); | 868 | " enforcing iSCSI Authentication, login failed.\n"); |