Add new scst_cmd_get_queue_type()/scst_cmd_set_queue_type() accessors and use them...
authorvlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Wed, 17 Mar 2010 19:11:18 +0000 (19:11 +0000)
committervlnb <vlnb@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Wed, 17 Mar 2010 19:11:18 +0000 (19:11 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1553 d57e44dd-8a1f-0410-8b47-8ef2f437770f

fcst/ft_cmd.c
iscsi-scst/kernel/iscsi.c
mvsas_tgt/mv_tgt.c
qla2x00t/qla2x00-target/qla2x00t.c
qla_isp/linux/isp_scst.c
scst/include/scst.h
scst_local/scst_local.c
srpt/src/ib_srpt.c

index 54fc18e..c10df60 100644 (file)
@@ -607,17 +607,17 @@ static void ft_recv_cmd(struct ft_sess *sess, struct fc_seq *sp,
 
        switch (fcp->fc_pri_ta & FCP_PTA_MASK) {
        case FCP_PTA_SIMPLE:
-               cmd->queue_type = SCST_CMD_QUEUE_SIMPLE;
+               scst_cmd_set_queue_type(cmd, SCST_CMD_QUEUE_SIMPLE);
                break;
        case FCP_PTA_HEADQ:
-               cmd->queue_type = SCST_CMD_QUEUE_HEAD_OF_QUEUE;
+               scst_cmd_set_queue_type(cmd, SCST_CMD_QUEUE_HEAD_OF_QUEUE);
                break;
        case FCP_PTA_ACA:
-               cmd->queue_type = SCST_CMD_QUEUE_ACA;
+               scst_cmd_set_queue_type(cmd, SCST_CMD_QUEUE_ACA);
                break;
        case FCP_PTA_ORDERED:
        default:
-               cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        }
 
index a32eeac..eaf06b6 100644 (file)
@@ -1847,24 +1847,24 @@ static int scsi_cmnd_start(struct iscsi_cmnd *req)
 
        switch (req_hdr->flags & ISCSI_CMD_ATTR_MASK) {
        case ISCSI_CMD_SIMPLE:
-               scst_cmd->queue_type = SCST_CMD_QUEUE_SIMPLE;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_SIMPLE);
                break;
        case ISCSI_CMD_HEAD_OF_QUEUE:
-               scst_cmd->queue_type = SCST_CMD_QUEUE_HEAD_OF_QUEUE;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_HEAD_OF_QUEUE);
                break;
        case ISCSI_CMD_ORDERED:
-               scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        case ISCSI_CMD_ACA:
-               scst_cmd->queue_type = SCST_CMD_QUEUE_ACA;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_ACA);
                break;
        case ISCSI_CMD_UNTAGGED:
-               scst_cmd->queue_type = SCST_CMD_QUEUE_UNTAGGED;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_UNTAGGED);
                break;
        default:
                PRINT_ERROR("Unknown task code %x, use ORDERED instead",
                        req_hdr->flags & ISCSI_CMD_ATTR_MASK);
-               scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        }
 
@@ -1895,7 +1895,7 @@ static int scsi_cmnd_start(struct iscsi_cmnd *req)
        }
 
        TRACE_DBG("START Command (itt %x, queue_type %d)",
-               req_hdr->itt, scst_cmd->queue_type);
+               req_hdr->itt, scst_cmd_get_queue_type(scst_cmd));
        req->scst_state = ISCSI_CMD_STATE_RX_CMD;
        conn->rx_task = current;
        scst_cmd_init_stage1_done(scst_cmd, SCST_CONTEXT_DIRECT, 0);
index f16d59a..b34962e 100644 (file)
@@ -1346,22 +1346,22 @@ static int mvst_do_send_cmd_to_scst(struct mvs_info *mvi, struct mvst_cmd *cmd)
 
        switch (cmd->command_iu->task_attr) {
        case TASK_ATTR_SIMPLE:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_SIMPLE;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_SIMPLE);
                break;
        case TASK_ATTR_HOQ:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_HEAD_OF_QUEUE;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_HEAD_OF_QUEUE);
                break;
        case TASK_ATTR_ORDERED:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        case TASK_ATTR_ACA:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_ACA;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_ACA);
                break;
        default:
                PRINT_ERROR("mvst tgt(%ld): Unknown task code %x, use "
                        "ORDERED instead", mvi->instance,
                        cmd->command_iu->task_attr);
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        }
 
index 8e65e16..26f5ef7 100644 (file)
@@ -2974,24 +2974,24 @@ static int q2x_do_send_cmd_to_scst(struct q2t_cmd *cmd)
 
        switch (atio->task_codes) {
        case ATIO_SIMPLE_QUEUE:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_SIMPLE;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_SIMPLE);
                break;
        case ATIO_HEAD_OF_QUEUE:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_HEAD_OF_QUEUE;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_HEAD_OF_QUEUE);
                break;
        case ATIO_ORDERED_QUEUE:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        case ATIO_ACA_QUEUE:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_ACA;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_ACA);
                break;
        case ATIO_UNTAGGED:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_UNTAGGED;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_UNTAGGED);
                break;
        default:
                PRINT_ERROR("qla2x00t: unknown task code %x, use "
                        "ORDERED instead", atio->task_codes);
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        }
 
@@ -3003,7 +3003,7 @@ static int q2x_do_send_cmd_to_scst(struct q2t_cmd *cmd)
 
        TRACE_DBG("Context %x", context);
        TRACE(TRACE_SCSI, "START Command (tag %d, queue_type %d)",
-               cmd->tag, cmd->scst_cmd->queue_type);
+               cmd->tag, scst_cmd_get_queue_type(cmd->scst_cmd));
        scst_cmd_init_done(cmd->scst_cmd, context);
 
 out:
@@ -3049,24 +3049,24 @@ static int q24_do_send_cmd_to_scst(struct q2t_cmd *cmd)
 
        switch (atio->fcp_cmnd.task_attr) {
        case ATIO_SIMPLE_QUEUE:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_SIMPLE;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_SIMPLE);
                break;
        case ATIO_HEAD_OF_QUEUE:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_HEAD_OF_QUEUE;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_HEAD_OF_QUEUE);
                break;
        case ATIO_ORDERED_QUEUE:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        case ATIO_ACA_QUEUE:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_ACA;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_ACA);
                break;
        case ATIO_UNTAGGED:
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_UNTAGGED;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_UNTAGGED);
                break;
        default:
                PRINT_ERROR("qla2x00t: unknown task code %x, use "
                        "ORDERED instead", atio->fcp_cmnd.task_attr);
-               cmd->scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(cmd->scst_cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        }
 
@@ -3078,7 +3078,7 @@ static int q24_do_send_cmd_to_scst(struct q2t_cmd *cmd)
 
        TRACE_DBG("Context %x", context);
        TRACE(TRACE_SCSI, "START Command %p (tag %d, queue type %x)", cmd,
-               cmd->tag, cmd->scst_cmd->queue_type);
+               cmd->tag, scst_cmd_get_queue_type(cmd->scst_cmd));
        scst_cmd_init_done(cmd->scst_cmd, context);
 
 out:
index f3260ea..e752018 100644 (file)
@@ -442,22 +442,22 @@ rx_loop:
 
     switch (tmd->cd_tagtype) {
         case CD_UNTAGGED:
-            scst_cmd->queue_type = SCST_CMD_QUEUE_UNTAGGED;
+            scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_UNTAGGED);
             break;
         case CD_SIMPLE_TAG:
-            scst_cmd->queue_type = SCST_CMD_QUEUE_SIMPLE;
+            scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_SIMPLE);
             break;
         case CD_ORDERED_TAG:
-            scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+            scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_ORDERED);
             break;
         case CD_HEAD_TAG:
-            scst_cmd->queue_type = SCST_CMD_QUEUE_HEAD_OF_QUEUE;
+            scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_HEAD_OF_QUEUE);
             break;
         case CD_ACA_TAG:
-            scst_cmd->queue_type = SCST_CMD_QUEUE_ACA;
+            scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_ACA);
             break;
         default:
-            scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+            scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_ORDERED);
             break;
     }
 
index 115910d..5c2bc74 100644 (file)
@@ -2832,6 +2832,21 @@ static inline int scst_cmd_get_sense_buffer_len(struct scst_cmd *cmd)
        return cmd->sense_valid_len;
 }
 
+/*
+ * Get/Set functions for cmd's queue_type
+ */
+static inline enum scst_cmd_queue_type scst_cmd_get_queue_type(
+       struct scst_cmd *cmd)
+{
+       return cmd->queue_type;
+}
+
+static inline void scst_cmd_set_queue_type(struct scst_cmd *cmd,
+       enum scst_cmd_queue_type queue_type)
+{
+       cmd->queue_type = queue_type;
+}
+
 /*
  * Get/Set functions for cmd's target SN
  */
index 7c9935a..50e8a12 100644 (file)
@@ -503,17 +503,17 @@ static int scst_local_queuecommand(struct scsi_cmnd *SCpnt,
        scst_cmd_set_tag(scst_cmd, SCpnt->tag);
        switch (scsi_get_tag_type(SCpnt->device)) {
        case MSG_SIMPLE_TAG:
-               scst_cmd->queue_type = SCST_CMD_QUEUE_SIMPLE;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_SIMPLE);
                break;
        case MSG_HEAD_TAG:
-               scst_cmd->queue_type = SCST_CMD_QUEUE_HEAD_OF_QUEUE;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_HEAD_OF_QUEUE);
                break;
        case MSG_ORDERED_TAG:
-               scst_cmd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_ORDERED);
                break;
        case SCSI_NO_TAG:
        default:
-               scst_cmd->queue_type = SCST_CMD_QUEUE_UNTAGGED;
+               scst_cmd_set_queue_type(scst_cmd, SCST_CMD_QUEUE_UNTAGGED);
                break;
        }
 
index 224fece..d4e964e 100644 (file)
@@ -1310,19 +1310,19 @@ static int srpt_handle_cmd(struct srpt_rdma_ch *ch, struct srpt_ioctx *ioctx,
 
        switch (srp_cmd->task_attr) {
        case SRP_CMD_HEAD_OF_Q:
-               scmnd->queue_type = SCST_CMD_QUEUE_HEAD_OF_QUEUE;
+               scst_cmd_set_queue_type(scmnd, SCST_CMD_QUEUE_HEAD_OF_QUEUE);
                break;
        case SRP_CMD_ORDERED_Q:
-               scmnd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(scmnd, SCST_CMD_QUEUE_ORDERED);
                break;
        case SRP_CMD_SIMPLE_Q:
-               scmnd->queue_type = SCST_CMD_QUEUE_SIMPLE;
+               scst_cmd_set_queue_type(scmnd, SCST_CMD_QUEUE_SIMPLE);
                break;
        case SRP_CMD_ACA:
-               scmnd->queue_type = SCST_CMD_QUEUE_ACA;
+               scst_cmd_set_queue_type(scmnd, SCST_CMD_QUEUE_ACA);
                break;
        default:
-               scmnd->queue_type = SCST_CMD_QUEUE_ORDERED;
+               scst_cmd_set_queue_type(scmnd, SCST_CMD_QUEUE_ORDERED);
                break;
        }