[PATCH] target: Use task management enumeration types consistently

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rename the task management function and task management function
response enumeration types such that these start with the "target_"
prefix. Use the task management enumeration types consistently for
variables and structure members that represent such values.

Signed-off-by: Bart Van Assche <bart.vanassche@xxxxxxxxxxx>
---
 drivers/infiniband/ulp/srpt/ib_srpt.c  |  2 +-
 drivers/scsi/qla2xxx/qla_target.c      |  2 +-
 drivers/scsi/qla2xxx/qla_target.h      |  3 ++-
 drivers/scsi/qla2xxx/tcm_qla2xxx.c     |  2 +-
 drivers/target/iscsi/iscsi_target.c    |  2 +-
 drivers/target/loopback/tcm_loop.c     | 11 ++++++-----
 drivers/target/target_core_tmr.c       |  2 +-
 drivers/target/target_core_transport.c |  2 +-
 drivers/target/tcm_fc/tfc_cmd.c        |  2 +-
 drivers/xen/xen-scsiback.c             |  2 +-
 include/target/target_core_base.h      |  8 ++++----
 include/target/target_core_fabric.h    |  4 ++--
 12 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 0d99d4e..66efee1 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1814,7 +1814,7 @@ static void srpt_handle_tsk_mgmt(struct srpt_rdma_ch *ch,
 	struct se_session *sess = ch->sess;
 	uint64_t unpacked_lun;
 	uint32_t tag = 0;
-	int tcm_tmr;
+	enum target_tmf tcm_tmr;
 	int rc;
 
 	BUG_ON(!send_ioctx);
diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c
index e7515069..96d0e40 100644
--- a/drivers/scsi/qla2xxx/qla_target.c
+++ b/drivers/scsi/qla2xxx/qla_target.c
@@ -3472,7 +3472,7 @@ static int qlt_issue_task_mgmt(struct qla_tgt_sess *sess, uint32_t lun,
 	struct qla_hw_data *ha = vha->hw;
 	struct qla_tgt_mgmt_cmd *mcmd;
 	int res;
-	uint8_t tmr_func;
+	enum target_tmf tmr_func;
 
 	mcmd = mempool_alloc(qla_tgt_mgmt_cmd_mempool, GFP_ATOMIC);
 	if (!mcmd) {
diff --git a/drivers/scsi/qla2xxx/qla_target.h b/drivers/scsi/qla2xxx/qla_target.h
index 985d76d..87d820e 100644
--- a/drivers/scsi/qla2xxx/qla_target.h
+++ b/drivers/scsi/qla2xxx/qla_target.h
@@ -28,6 +28,7 @@
 #ifndef __QLA_TARGET_H
 #define __QLA_TARGET_H
 
+#include <target/target_core_base.h>
 #include "qla_def.h"
 
 /*
@@ -706,7 +707,7 @@ struct qla_tgt_func_tmpl {
 			unsigned char *, uint32_t, int, int, int);
 	void (*handle_data)(struct qla_tgt_cmd *);
 	void (*handle_dif_err)(struct qla_tgt_cmd *);
-	int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, uint32_t, uint8_t,
+	int (*handle_tmr)(struct qla_tgt_mgmt_cmd *, uint32_t, enum target_tmf,
 			uint32_t);
 	void (*free_cmd)(struct qla_tgt_cmd *);
 	void (*free_mcmd)(struct qla_tgt_mgmt_cmd *);
diff --git a/drivers/scsi/qla2xxx/tcm_qla2xxx.c b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
index 1ee4d6c..f5f0942 100644
--- a/drivers/scsi/qla2xxx/tcm_qla2xxx.c
+++ b/drivers/scsi/qla2xxx/tcm_qla2xxx.c
@@ -639,7 +639,7 @@ static void tcm_qla2xxx_handle_dif_err(struct qla_tgt_cmd *cmd)
  * Called from qla_target.c:qlt_issue_task_mgmt()
  */
 static int tcm_qla2xxx_handle_tmr(struct qla_tgt_mgmt_cmd *mcmd, uint32_t lun,
-	uint8_t tmr_func, uint32_t tag)
+	enum target_tmf tmr_func, uint32_t tag)
 {
 	struct qla_tgt_sess *sess = mcmd->sess;
 	struct se_cmd *se_cmd = &mcmd->se_cmd;
diff --git a/drivers/target/iscsi/iscsi_target.c b/drivers/target/iscsi/iscsi_target.c
index 97a1c1eb..6dfc71c 100644
--- a/drivers/target/iscsi/iscsi_target.c
+++ b/drivers/target/iscsi/iscsi_target.c
@@ -1805,7 +1805,7 @@ iscsit_handle_task_mgt_cmd(struct iscsi_conn *conn, struct iscsi_cmd *cmd,
 	 */
 	if (function != ISCSI_TM_FUNC_TASK_REASSIGN) {
 
-		u8 tcm_function;
+		enum target_tmf tcm_function;
 		int ret;
 
 		transport_init_se_cmd(&cmd->se_cmd, &iscsi_ops,
diff --git a/drivers/target/loopback/tcm_loop.c b/drivers/target/loopback/tcm_loop.c
index 6ba7b8d..ca5f482 100644
--- a/drivers/target/loopback/tcm_loop.c
+++ b/drivers/target/loopback/tcm_loop.c
@@ -217,8 +217,8 @@ static int tcm_loop_queuecommand(struct Scsi_Host *sh, struct scsi_cmnd *sc)
  * Called from SCSI EH process context to issue a LUN_RESET TMR
  * to struct scsi_device
  */
-static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg,
-			      int lun, int task, enum tcm_tmreq_table tmr)
+static enum target_tmrsp tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg,
+			      int lun, int task, enum target_tmf tmr)
 {
 	struct se_cmd *se_cmd = NULL;
 	struct se_session *se_sess;
@@ -226,7 +226,8 @@ static int tcm_loop_issue_tmr(struct tcm_loop_tpg *tl_tpg,
 	struct tcm_loop_nexus *tl_nexus;
 	struct tcm_loop_cmd *tl_cmd = NULL;
 	struct tcm_loop_tmr *tl_tmr = NULL;
-	int ret = TMR_FUNCTION_FAILED, rc;
+	enum target_tmrsp ret = TMR_FUNCTION_FAILED;
+	int rc;
 
 	/*
 	 * Locate the tl_nexus and se_sess pointers
@@ -299,7 +300,7 @@ static int tcm_loop_abort_task(struct scsi_cmnd *sc)
 {
 	struct tcm_loop_hba *tl_hba;
 	struct tcm_loop_tpg *tl_tpg;
-	int ret = FAILED;
+	enum target_tmrsp ret;
 
 	/*
 	 * Locate the tcm_loop_hba_t pointer
@@ -319,7 +320,7 @@ static int tcm_loop_device_reset(struct scsi_cmnd *sc)
 {
 	struct tcm_loop_hba *tl_hba;
 	struct tcm_loop_tpg *tl_tpg;
-	int ret = FAILED;
+	enum target_tmrsp ret;
 
 	/*
 	 * Locate the tcm_loop_hba_t pointer
diff --git a/drivers/target/target_core_tmr.c b/drivers/target/target_core_tmr.c
index c6e21ac..bf50d7e 100644
--- a/drivers/target/target_core_tmr.c
+++ b/drivers/target/target_core_tmr.c
@@ -42,7 +42,7 @@
 int core_tmr_alloc_req(
 	struct se_cmd *se_cmd,
 	void *fabric_tmr_ptr,
-	u8 function,
+	enum target_tmf function,
 	gfp_t gfp_flags)
 {
 	struct se_tmr_req *tmr;
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index cac8de0..395a5b1 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -1566,7 +1566,7 @@ static void target_complete_tmr_failure(struct work_struct *work)
 
 int target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
 		unsigned char *sense, u32 unpacked_lun,
-		void *fabric_tmr_ptr, unsigned char tm_type,
+		void *fabric_tmr_ptr, enum target_tmf tm_type,
 		gfp_t gfp, unsigned int tag, int flags)
 {
 	struct se_portal_group *se_tpg;
diff --git a/drivers/target/tcm_fc/tfc_cmd.c b/drivers/target/tcm_fc/tfc_cmd.c
index 6bdd87d..862b1a9 100644
--- a/drivers/target/tcm_fc/tfc_cmd.c
+++ b/drivers/target/tcm_fc/tfc_cmd.c
@@ -382,7 +382,7 @@ static void ft_send_tm(struct ft_cmd *cmd)
 {
 	struct fcp_cmnd *fcp;
 	int rc;
-	u8 tm_func;
+	enum target_tmf tm_func;
 
 	fcp = fc_frame_payload_get(cmd->req_frame, sizeof(*fcp));
 
diff --git a/drivers/xen/xen-scsiback.c b/drivers/xen/xen-scsiback.c
index 38db4cd..dc54fed 100644
--- a/drivers/xen/xen-scsiback.c
+++ b/drivers/xen/xen-scsiback.c
@@ -591,7 +591,7 @@ static void scsiback_disconnect(struct vscsibk_info *info)
 }
 
 static void scsiback_device_action(struct vscsibk_pend *pending_req,
-	enum tcm_tmreq_table act, int tag)
+	enum target_tmf act, int tag)
 {
 	int rc, err = FAILED;
 	struct scsiback_tpg *tpg = pending_req->v2p->tpg;
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index dd31b6d..9d645ce 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -219,7 +219,7 @@ enum target_sc_flags_table {
 };
 
 /* fabric independent task management function values */
-enum tcm_tmreq_table {
+enum target_tmf {
 	TMR_ABORT_TASK		= 1,
 	TMR_ABORT_TASK_SET	= 2,
 	TMR_CLEAR_ACA		= 3,
@@ -230,7 +230,7 @@ enum tcm_tmreq_table {
 };
 
 /* fabric independent task management response values */
-enum tcm_tmrsp_table {
+enum target_tmrsp {
 	TMR_FUNCTION_FAILED		= 0,
 	TMR_FUNCTION_COMPLETE		= 1,
 	TMR_TASK_DOES_NOT_EXIST		= 2,
@@ -426,9 +426,9 @@ struct t10_reservation {
 
 struct se_tmr_req {
 	/* Task Management function to be performed */
-	u8			function;
+	enum target_tmf		function;
 	/* Task Management response to send */
-	u8			response;
+	enum target_tmrsp	response;
 	int			call_transport;
 	/* Reference to ITT that Task Mgmt should be performed */
 	u64			ref_task_tag;
diff --git a/include/target/target_core_fabric.h b/include/target/target_core_fabric.h
index f1bb5a4..94e1831 100644
--- a/include/target/target_core_fabric.h
+++ b/include/target/target_core_fabric.h
@@ -139,7 +139,7 @@ int	target_submit_cmd(struct se_cmd *, struct se_session *, unsigned char *,
 		unsigned char *, u32, u32, int, int, int);
 int	target_submit_tmr(struct se_cmd *se_cmd, struct se_session *se_sess,
 		unsigned char *sense, u32 unpacked_lun,
-		void *fabric_tmr_ptr, unsigned char tm_type,
+		void *fabric_tmr_ptr, enum target_tmf tm_type,
 		gfp_t, unsigned int, int);
 int	transport_handle_cdb_direct(struct se_cmd *);
 sense_reason_t	transport_generic_new_cmd(struct se_cmd *);
@@ -159,7 +159,7 @@ void	target_wait_for_sess_cmds(struct se_session *);
 
 int	core_alua_check_nonop_delay(struct se_cmd *);
 
-int	core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
+int	core_tmr_alloc_req(struct se_cmd *, void *, enum target_tmf, gfp_t);
 void	core_tmr_release_req(struct se_tmr_req *);
 int	transport_generic_handle_tmr(struct se_cmd *);
 void	transport_generic_request_failure(struct se_cmd *, sense_reason_t);
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux SCSI]     [Kernel Newbies]     [Linux SCSI Target Infrastructure]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Device Mapper]

  Powered by Linux