[PATCH 4/5] target: remove the t_tasks_bidi se_cmd field

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

 



And use a SCF_BIDI flag instead.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>

Index: lio-core/drivers/target/loopback/tcm_loop.c
===================================================================
--- lio-core.orig/drivers/target/loopback/tcm_loop.c	2011-11-14 17:08:48.000000000 +0100
+++ lio-core/drivers/target/loopback/tcm_loop.c	2011-11-14 17:23:34.241258794 +0100
@@ -113,11 +113,9 @@ static struct se_cmd *tcm_loop_allocate_
 			scsi_bufflen(sc), sc->sc_data_direction, sam_task_attr,
 			&tl_cmd->tl_sense_buf[0]);
 
-	/*
-	 * Signal BIDI usage with T_TASK(cmd)->t_tasks_bidi
-	 */
 	if (scsi_bidi_cmnd(sc))
-		se_cmd->t_tasks_bidi = 1;
+		se_cmd->se_cmd_flags |= SCF_BIDI;
+
 	/*
 	 * Locate the struct se_lun pointer and attach it to struct se_cmd
 	 */
@@ -154,7 +152,7 @@ static int tcm_loop_new_cmd_map(struct s
 	 * For BIDI commands, pass in the extra READ buffer
 	 * to transport_generic_map_mem_to_cmd() below..
 	 */
-	if (se_cmd->t_tasks_bidi) {
+	if (se_cmd->se_cmd_flags & SCF_BIDI) {
 		struct scsi_data_buffer *sdb = scsi_in(sc);
 
 		sgl_bidi = sdb->table.sgl;
Index: lio-core/drivers/target/target_core_transport.c
===================================================================
--- lio-core.orig/drivers/target/target_core_transport.c	2011-11-14 17:15:02.000000000 +0100
+++ lio-core/drivers/target/target_core_transport.c	2011-11-14 17:23:34.244592127 +0100
@@ -2600,7 +2600,7 @@ static int transport_generic_cmd_sequenc
 		break;
 	case XDWRITEREAD_10:
 		if ((cmd->data_direction != DMA_TO_DEVICE) ||
-		    !(cmd->t_tasks_bidi))
+		    !(cmd->se_cmd_flags & SCF_BIDI))
 			goto out_invalid_cdb_field;
 		sectors = transport_get_sectors_10(cdb, cmd, &sector_ret);
 		if (sector_ret)
Index: lio-core/drivers/target/tcm_qla2xxx/tcm_qla2xxx_fabric.c
===================================================================
--- lio-core.orig/drivers/target/tcm_qla2xxx/tcm_qla2xxx_fabric.c	2011-11-09 09:08:53.000000000 +0100
+++ lio-core/drivers/target/tcm_qla2xxx/tcm_qla2xxx_fabric.c	2011-11-14 17:24:11.621258581 +0100
@@ -588,7 +588,7 @@ u32 tcm_qla2xxx_sess_get_index(struct se
  */
 static enum dma_data_direction tcm_qla2xxx_mapping_dir(struct se_cmd *se_cmd)
 {
-	if (se_cmd->t_tasks_bidi)
+	if (se_cmd->se_cmd_flags & SCF_BIDI)
 		return DMA_BIDIRECTIONAL;
 
 	switch (se_cmd->data_direction) {
@@ -696,12 +696,9 @@ int tcm_qla2xxx_init_cmd(scsi_qla_host_t
  	 * Protected by qla_hw_data->hardware_lock
  	 */
 	target_get_sess_cmd(se_sess, se_cmd);
-	/*
-	 * Signal BIDI usage with T_TASK(cmd)->t_tasks_bidi
-	 */
-	if (bidi)
-		se_cmd->t_tasks_bidi = 1;
 
+	if (bidi)
+		se_cmd->se_cmd_flags |= SCF_BIDI;
 	return 0;
 }
 
Index: lio-core/drivers/target/tcm_vhost/tcm_vhost_fabric.c
===================================================================
--- lio-core.orig/drivers/target/tcm_vhost/tcm_vhost_fabric.c	2011-11-05 11:33:12.000000000 +0100
+++ lio-core/drivers/target/tcm_vhost/tcm_vhost_fabric.c	2011-11-14 17:23:34.247925460 +0100
@@ -254,7 +254,7 @@ int tcm_vhost_new_cmd_map(struct se_cmd
 		 */
 #warning FIXME: Fix BIDI operation in tcm_vhost_new_cmd_map()
 #if 0
-		if (T_TASK(se_cmd)->t_tasks_bidi) {
+		if (se_cmd->se_cmd_flags & SCF_BIDI) {
 			mem_bidi_ptr = NULL;
 			sg_no_bidi = 0;
 		}
Index: lio-core/drivers/target/tcm_vhost/tcm_vhost_scsi.c
===================================================================
--- lio-core.orig/drivers/target/tcm_vhost/tcm_vhost_scsi.c	2011-11-09 09:08:44.000000000 +0100
+++ lio-core/drivers/target/tcm_vhost/tcm_vhost_scsi.c	2011-11-14 17:23:34.251258794 +0100
@@ -151,13 +151,9 @@ static struct tcm_vhost_cmd *vhost_scsi_
 				data_direction, sam_task_attr,
 				&tv_cmd->tvc_sense_buf[0]);
 
-#warning FIXME: vhost_scsi_allocate_cmd() BIDI operation
-#if 0
-	/*
-	 * Signal BIDI usage with T_TASK(cmd)->t_tasks_bidi
-	 */
+#if 0	/* FIXME: vhost_scsi_allocate_cmd() BIDI operation */
 	if (bidi)
-		T_TASK(se_cmd)->t_tasks_bidi = 1;
+		se_cmd->se_cmd_flags |= SCF_BIDI;
 #endif
 	/*
 	 * From here the rest of the se_cmd will be setup and dispatched
Index: lio-core/include/target/target_core_base.h
===================================================================
--- lio-core.orig/include/target/target_core_base.h	2011-11-14 17:15:46.000000000 +0100
+++ lio-core/include/target/target_core_base.h	2011-11-14 17:23:34.251258794 +0100
@@ -106,6 +106,7 @@ enum se_cmd_flags_table {
 	SCF_FUA				= 0x00000200,
 	SCF_SE_LUN_CMD			= 0x00000800,
 	SCF_SE_ALLOW_EOO		= 0x00001000,
+	SCF_BIDI			= 0x00002000,
 	SCF_SENT_CHECK_CONDITION	= 0x00004000,
 	SCF_OVERFLOW_BIT		= 0x00008000,
 	SCF_UNDERFLOW_BIT		= 0x00010000,
@@ -459,7 +460,6 @@ struct se_cmd {
 	unsigned char		__t_task_cdb[TCM_MAX_COMMAND_SIZE];
 	unsigned long long	t_task_lba;
 	int			t_tasks_failed;
-	bool			t_tasks_bidi;
 	u32			t_tasks_sg_chained_no;
 	atomic_t		t_fe_count;
 	atomic_t		t_se_count;

--
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