Cleanup mgmt parameters initialization.

It's better to do it via a single function.

Patch from Alexey Obitotskiy <alexeyo1@open-e.com>



git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@4165 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Vladislav Bolkhovitin
2012-03-23 22:03:22 +00:00
parent 937b2d550d
commit d5ffb2234b
3 changed files with 14 additions and 4 deletions

View File

@@ -505,7 +505,8 @@ static void ft_recv_tm(struct scst_session *scst_sess,
struct scst_rx_mgmt_params params;
int ret;
memset(&params, 0, sizeof(params));
scst_rx_mgmt_params_init(&params);
params.lun = fcp->fc_lun;
params.lun_len = sizeof(fcp->fc_lun);
params.lun_set = 1;

View File

@@ -2531,7 +2531,8 @@ static void execute_task_management(struct iscsi_cmnd *req)
} else
spin_unlock(&sess->sn_lock);
memset(&params, 0, sizeof(params));
scst_rx_mgmt_params_init(&params);
params.atomic = SCST_NON_ATOMIC;
params.tgt_priv = req;

View File

@@ -2837,6 +2837,12 @@ void scst_tgt_cmd_done(struct scst_cmd *cmd,
int scst_rx_mgmt_fn(struct scst_session *sess,
const struct scst_rx_mgmt_params *params);
static inline void scst_rx_mgmt_params_init(
struct scst_rx_mgmt_params *params)
{
memset(params, 0, sizeof(*params));
}
/*
* Creates new management command using tag and sends it for execution.
* Can be used for SCST_ABORT_TASK only.
@@ -2852,7 +2858,8 @@ static inline int scst_rx_mgmt_fn_tag(struct scst_session *sess, int fn,
BUG_ON(fn != SCST_ABORT_TASK);
memset(&params, 0, sizeof(params));
scst_rx_mgmt_params_init(&params);
params.fn = fn;
params.tag = tag;
params.tag_set = 1;
@@ -2876,7 +2883,8 @@ static inline int scst_rx_mgmt_fn_lun(struct scst_session *sess, int fn,
BUG_ON(fn == SCST_ABORT_TASK);
memset(&params, 0, sizeof(params));
scst_rx_mgmt_params_init(&params);
params.fn = fn;
params.lun = lun;
params.lun_len = lun_len;