scst_rx_mgmt_fn_lun(): Change 3rd arg from u8 * into void *

This change allows to remove several casts and hence improves
source code readability.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4169 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-03-27 01:40:45 +00:00
parent e275e68d49
commit 90670b1c83
9 changed files with 29 additions and 53 deletions
+4 -8
View File
@@ -671,26 +671,22 @@ static int process_tsk_mgmt(struct iu_entry *iue)
break;
case SRP_TSK_ABORT_TASK_SET:
ret = scst_rx_mgmt_fn_lun(sess, SCST_ABORT_TASK_SET,
(u8 *) &srp_tsk->lun,
sizeof srp_tsk->lun,
&srp_tsk->lun, sizeof(srp_tsk->lun),
SCST_ATOMIC, mgmt_ctx);
break;
case SRP_TSK_CLEAR_TASK_SET:
ret = scst_rx_mgmt_fn_lun(sess, SCST_CLEAR_TASK_SET,
(u8 *) &srp_tsk->lun,
sizeof srp_tsk->lun,
&srp_tsk->lun, sizeof(srp_tsk->lun),
SCST_ATOMIC, mgmt_ctx);
break;
case SRP_TSK_LUN_RESET:
ret = scst_rx_mgmt_fn_lun(sess, SCST_LUN_RESET,
(u8 *) &srp_tsk->lun,
sizeof srp_tsk->lun,
&srp_tsk->lun, sizeof(srp_tsk->lun),
SCST_ATOMIC, mgmt_ctx);
break;
case SRP_TSK_CLEAR_ACA:
ret = scst_rx_mgmt_fn_lun(sess, SCST_CLEAR_ACA,
(u8 *) &srp_tsk->lun,
sizeof srp_tsk->lun,
&srp_tsk->lun, sizeof(srp_tsk->lun),
SCST_ATOMIC, mgmt_ctx);
break;
default:
+2 -2
View File
@@ -422,7 +422,7 @@ static void close_conn(struct iscsi_conn *conn)
/* Abort all outstanding commands */
rc = scst_rx_mgmt_fn_lun(session->scst_sess,
SCST_ABORT_ALL_TASKS_SESS, (uint8_t *)&lun, sizeof(lun),
SCST_ABORT_ALL_TASKS_SESS, &lun, sizeof(lun),
SCST_NON_ATOMIC, conn);
if (rc != 0)
PRINT_ERROR("SCST_ABORT_ALL_TASKS_SESS failed %d", rc);
@@ -431,7 +431,7 @@ static void close_conn(struct iscsi_conn *conn)
int lun = 0;
rc = scst_rx_mgmt_fn_lun(session->scst_sess,
SCST_NEXUS_LOSS_SESS, (uint8_t *)&lun, sizeof(lun),
SCST_NEXUS_LOSS_SESS, &lun, sizeof(lun),
SCST_NON_ATOMIC, conn);
if (rc != 0)
PRINT_ERROR("SCST_NEXUS_LOSS_SESS failed %d", rc);
+5 -10
View File
@@ -1916,35 +1916,30 @@ mpt_handle_task_mgmt(MPT_STM_PRIV *priv, u32 reply_word,
case IMM_NTFY_CLEAR_ACA:
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_CLEAR_ACA received");
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_CLEAR_ACA,
(uint8_t *)&lun, sizeof(lun),
SCST_ATOMIC, mcmd);
&lun, sizeof(lun), SCST_ATOMIC, mcmd);
break;
case IMM_NTFY_TARGET_RESET:
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_TARGET_RESET received");
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_TARGET_RESET,
(uint8_t *)&lun, sizeof(lun),
SCST_ATOMIC, mcmd);
&lun, sizeof(lun), SCST_ATOMIC, mcmd);
break;
case IMM_NTFY_LUN_RESET1:
case IMM_NTFY_LUN_RESET2:
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_LUN_RESET received");
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_LUN_RESET,
(uint8_t *)&lun, sizeof(lun),
SCST_ATOMIC, mcmd);
&lun, sizeof(lun), SCST_ATOMIC, mcmd);
break;
case IMM_NTFY_CLEAR_TS:
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_CLEAR_TS received");
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_CLEAR_TASK_SET,
(uint8_t *)&lun, sizeof(lun),
SCST_ATOMIC, mcmd);
&lun, sizeof(lun), SCST_ATOMIC, mcmd);
break;
case IMM_NTFY_ABORT_TS1:
case IMM_NTFY_ABORT_TS2:
TRACE(TRACE_MGMT, "%s", "IMM_NTFY_ABORT_TS received");
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_ABORT_TASK_SET,
(uint8_t *)&lun, sizeof(lun),
SCST_ATOMIC, mcmd);
&lun, sizeof(lun), SCST_ATOMIC, mcmd);
break;
default:
+4 -8
View File
@@ -1682,29 +1682,25 @@ static int mvst_handle_task_mgmt(struct mvs_info *mvi,
case TMF_CLEAR_ACA:
TRACE(TRACE_MGMT, "%s", "TMF_CLEAR_ACA received");
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_CLEAR_ACA,
(uint8_t *)lun, sizeof(lun),
SCST_ATOMIC, cmd);
&lun, sizeof(lun), SCST_ATOMIC, cmd);
break;
case TMF_LU_RESET:
TRACE(TRACE_MGMT, "%s", "TMF_LU_RESET received");
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_LUN_RESET,
(uint8_t *)&lun, sizeof(lun),
SCST_ATOMIC, cmd);
&lun, sizeof(lun), SCST_ATOMIC, cmd);
break;
case TMF_CLEAR_TASK_SET:
TRACE(TRACE_MGMT, "%s", "TMF_CLEAR_TASK_SET received");
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_CLEAR_TASK_SET,
(uint8_t *)&lun, sizeof(lun),
SCST_ATOMIC, cmd);
&lun, sizeof(lun), SCST_ATOMIC, cmd);
break;
case TMF_ABORT_TASK_SET:
TRACE(TRACE_MGMT, "%s", "TMF_ABORT_TASK_SET received");
rc = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_ABORT_TASK_SET,
(uint8_t *)&lun, sizeof(lun),
SCST_ATOMIC, cmd);
&lun, sizeof(lun), SCST_ATOMIC, cmd);
break;
case TMF_ABORT_TASK:
+1 -1
View File
@@ -2877,7 +2877,7 @@ static inline int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn,
* Obsolete in favor of scst_rx_mgmt_fn()
*/
static inline int scst_rx_mgmt_fn_lun(struct scst_session *sess, int fn,
const uint8_t *lun, int lun_len, int atomic, void *tgt_priv)
const void *lun, int lun_len, int atomic, void *tgt_priv)
{
struct scst_rx_mgmt_params params;
+1 -1
View File
@@ -551,7 +551,7 @@ static void scst_pr_abort_reg(struct scst_device *dev,
packed_lun = scst_pack_lun(reg->tgt_dev->lun, sess->acg->addr_method);
rc = scst_rx_mgmt_fn_lun(sess, SCST_PR_ABORT_ALL,
(uint8_t *)&packed_lun, sizeof(packed_lun), SCST_NON_ATOMIC,
&packed_lun, sizeof(packed_lun), SCST_NON_ATOMIC,
pr_cmd);
if (rc != 0) {
/*
+1 -1
View File
@@ -6483,7 +6483,7 @@ void scst_unregister_session(struct scst_session *sess, int wait,
/* Abort all outstanding commands and clear reservation, if necessary */
lun = 0;
rc = scst_rx_mgmt_fn_lun(sess, SCST_UNREG_SESS_TM,
(uint8_t *)&lun, sizeof(lun), SCST_ATOMIC, NULL);
&lun, sizeof(lun), SCST_ATOMIC, NULL);
if (rc != 0) {
PRINT_ERROR("SCST_UNREG_SESS_TM failed %d (sess %p)",
rc, sess);
+2 -4
View File
@@ -826,8 +826,7 @@ static int scst_local_device_reset(struct scsi_cmnd *SCpnt)
lun = cpu_to_be16(SCpnt->device->lun);
ret = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_LUN_RESET,
(const uint8_t *)&lun, sizeof(lun), false,
&dev_reset_completion);
&lun, sizeof(lun), false, &dev_reset_completion);
/* Now wait for the completion ... */
wait_for_completion_interruptible(&dev_reset_completion);
@@ -856,8 +855,7 @@ static int scst_local_target_reset(struct scsi_cmnd *SCpnt)
lun = cpu_to_be16(SCpnt->device->lun);
ret = scst_rx_mgmt_fn_lun(sess->scst_sess, SCST_TARGET_RESET,
(const uint8_t *)&lun, sizeof(lun), false,
&dev_reset_completion);
&lun, sizeof(lun), false, &dev_reset_completion);
/* Now wait for the completion ... */
wait_for_completion_interruptible(&dev_reset_completion);
+9 -18
View File
@@ -1746,41 +1746,32 @@ static u8 srpt_handle_tsk_mgmt(struct srpt_rdma_ch *ch,
switch (srp_tsk->tsk_mgmt_func) {
case SRP_TSK_ABORT_TASK:
TRACE_DBG("Processing SRP_TSK_ABORT_TASK");
ret = scst_rx_mgmt_fn_tag(ch->scst_sess,
SCST_ABORT_TASK,
ret = scst_rx_mgmt_fn_tag(ch->scst_sess, SCST_ABORT_TASK,
srp_tsk->task_tag,
SCST_ATOMIC, send_ioctx);
break;
case SRP_TSK_ABORT_TASK_SET:
TRACE_DBG("Processing SRP_TSK_ABORT_TASK_SET");
ret = scst_rx_mgmt_fn_lun(ch->scst_sess,
SCST_ABORT_TASK_SET,
(u8 *) &srp_tsk->lun,
sizeof srp_tsk->lun,
ret = scst_rx_mgmt_fn_lun(ch->scst_sess, SCST_ABORT_TASK_SET,
&srp_tsk->lun, sizeof(srp_tsk->lun),
SCST_ATOMIC, send_ioctx);
break;
case SRP_TSK_CLEAR_TASK_SET:
TRACE_DBG("Processing SRP_TSK_CLEAR_TASK_SET");
ret = scst_rx_mgmt_fn_lun(ch->scst_sess,
SCST_CLEAR_TASK_SET,
(u8 *) &srp_tsk->lun,
sizeof srp_tsk->lun,
ret = scst_rx_mgmt_fn_lun(ch->scst_sess, SCST_CLEAR_TASK_SET,
&srp_tsk->lun, sizeof(srp_tsk->lun),
SCST_ATOMIC, send_ioctx);
break;
case SRP_TSK_LUN_RESET:
TRACE_DBG("Processing SRP_TSK_LUN_RESET");
ret = scst_rx_mgmt_fn_lun(ch->scst_sess,
SCST_LUN_RESET,
(u8 *) &srp_tsk->lun,
sizeof srp_tsk->lun,
ret = scst_rx_mgmt_fn_lun(ch->scst_sess, SCST_LUN_RESET,
&srp_tsk->lun, sizeof(srp_tsk->lun),
SCST_ATOMIC, send_ioctx);
break;
case SRP_TSK_CLEAR_ACA:
TRACE_DBG("Processing SRP_TSK_CLEAR_ACA");
ret = scst_rx_mgmt_fn_lun(ch->scst_sess,
SCST_CLEAR_ACA,
(u8 *) &srp_tsk->lun,
sizeof srp_tsk->lun,
ret = scst_rx_mgmt_fn_lun(ch->scst_sess, SCST_CLEAR_ACA,
&srp_tsk->lun, sizeof(srp_tsk->lun),
SCST_ATOMIC, send_ioctx);
break;
default: