mirror of
https://github.com/SCST-project/scst.git
synced 2026-05-17 10:41:26 +00:00
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:
@@ -505,7 +505,8 @@ static void ft_recv_tm(struct scst_session *scst_sess,
|
||||
struct scst_rx_mgmt_params params;
|
||||
int ret;
|
||||
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
scst_rx_mgmt_params_init(¶ms);
|
||||
|
||||
params.lun = fcp->fc_lun;
|
||||
params.lun_len = sizeof(fcp->fc_lun);
|
||||
params.lun_set = 1;
|
||||
|
||||
@@ -2531,7 +2531,8 @@ static void execute_task_management(struct iscsi_cmnd *req)
|
||||
} else
|
||||
spin_unlock(&sess->sn_lock);
|
||||
|
||||
memset(¶ms, 0, sizeof(params));
|
||||
scst_rx_mgmt_params_init(¶ms);
|
||||
|
||||
params.atomic = SCST_NON_ATOMIC;
|
||||
params.tgt_priv = req;
|
||||
|
||||
|
||||
@@ -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(¶ms, 0, sizeof(params));
|
||||
scst_rx_mgmt_params_init(¶ms);
|
||||
|
||||
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(¶ms, 0, sizeof(params));
|
||||
scst_rx_mgmt_params_init(¶ms);
|
||||
|
||||
params.fn = fn;
|
||||
params.lun = lun;
|
||||
params.lun_len = lun_len;
|
||||
|
||||
Reference in New Issue
Block a user