scst: Introduce struct scst_icmd_priv

This patch does not change any functionality but improves source code
readability.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@8511 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2019-08-21 21:30:39 +00:00
parent 740f3a6e63
commit dd52454052
3 changed files with 11 additions and 7 deletions
+2 -1
View File
@@ -3726,8 +3726,9 @@ static int scst_cm_release(struct scst_tgt *tgt)
static int scst_cm_xmit_response(struct scst_cmd *cmd)
{
struct scst_icmd_priv *icmd_priv = cmd->tgt_i_priv;
scst_i_finish_fn_t f = icmd_priv->finish_fn;
int res = SCST_TGT_RES_SUCCESS;
scst_i_finish_fn_t f = (void *) *((unsigned long long **)cmd->tgt_i_priv);
TRACE_ENTRY();
+4 -6
View File
@@ -6944,8 +6944,9 @@ out_done:
int scst_finish_internal_cmd(struct scst_cmd *cmd)
{
int res;
struct scst_icmd_priv *icmd_priv = cmd->tgt_i_priv;
unsigned long flags;
int res;
TRACE_ENTRY();
@@ -6971,11 +6972,8 @@ int scst_finish_internal_cmd(struct scst_cmd *cmd)
if (cmd->cdb[0] == REQUEST_SENSE)
scst_complete_request_sense(cmd);
else {
scst_i_finish_fn_t f = (void *) *((unsigned long long **)cmd->tgt_i_priv);
f(cmd);
}
else
icmd_priv->finish_fn(cmd);
__scst_cmd_put(cmd);
+5
View File
@@ -157,6 +157,11 @@ static inline void scst_set_cmd_state(struct scst_cmd *cmd,
typedef void (*scst_i_finish_fn_t) (struct scst_cmd *cmd);
/* Private data associated with an internal command. */
struct scst_icmd_priv {
scst_i_finish_fn_t finish_fn;
};
extern struct mutex scst_mutex2;
extern int scst_threads;