[PATCH 6/7] target: remove the t_task_cdbs_ex_left field in struct se_cmd

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

 



Now that tasks are gone we are guaranteed to only get a single completion
per command, and thus don't need this counter.

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

---
 drivers/target/target_core_tmr.c       |    7 -------
 drivers/target/target_core_transport.c |    7 +------
 include/target/target_core_base.h      |    1 -
 3 files changed, 1 insertion(+), 14 deletions(-)

Index: lio-core/drivers/target/target_core_tmr.c
===================================================================
--- lio-core.orig/drivers/target/target_core_tmr.c	2012-04-24 06:10:38.568372875 +0200
+++ lio-core/drivers/target/target_core_tmr.c	2012-04-24 06:11:36.920374369 +0200
@@ -333,13 +333,6 @@ static void core_tmr_drain_state_list(
 		spin_lock_irqsave(&cmd->t_state_lock, flags);
 		target_stop_cmd(cmd, &flags);
 
-		if (!atomic_dec_and_test(&cmd->t_task_cdbs_ex_left)) {
-			spin_unlock_irqrestore(&cmd->t_state_lock, flags);
-			pr_debug("LUN_RESET: Skipping cmd: %p, dev: %p for"
-				" t_task_cdbs_ex_left: %d\n", cmd, dev,
-				atomic_read(&cmd->t_task_cdbs_ex_left));
-			continue;
-		}
 		fe_count = atomic_read(&cmd->t_fe_count);
 
 		if (!(cmd->transport_state & CMD_T_ACTIVE)) {
Index: lio-core/drivers/target/target_core_transport.c
===================================================================
--- lio-core.orig/drivers/target/target_core_transport.c	2012-04-24 06:10:38.572372875 +0200
+++ lio-core/drivers/target/target_core_transport.c	2012-04-24 06:11:36.920374369 +0200
@@ -457,7 +457,6 @@ static void target_remove_from_state_lis
 	spin_lock_irqsave(&dev->execute_task_lock, flags);
 	if (cmd->state_active) {
 		list_del(&cmd->state_list);
-		atomic_dec(&cmd->t_task_cdbs_ex_left);
 		cmd->state_active = false;
 	}
 	spin_unlock_irqrestore(&dev->execute_task_lock, flags);
@@ -1771,9 +1770,7 @@ void transport_generic_request_failure(s
 	pr_debug("-----[ i_state: %d t_state: %d scsi_sense_reason: %d\n",
 		cmd->se_tfo->get_cmd_state(cmd),
 		cmd->t_state, cmd->scsi_sense_reason);
-	pr_debug("-----[ t_task_cdbs_ex_left: %d --"
-		" CMD_T_ACTIVE: %d CMD_T_STOP: %d CMD_T_SENT: %d\n",
-		atomic_read(&cmd->t_task_cdbs_ex_left),
+	pr_debug("-----[ CMD_T_ACTIVE: %d CMD_T_STOP: %d CMD_T_SENT: %d\n",
 		(cmd->transport_state & CMD_T_ACTIVE) != 0,
 		(cmd->transport_state & CMD_T_STOP) != 0,
 		(cmd->transport_state & CMD_T_SENT) != 0);
@@ -3499,8 +3496,6 @@ int transport_generic_new_cmd(struct se_
 	atomic_inc(&cmd->t_fe_count);
 	atomic_inc(&cmd->t_se_count);
 
-	atomic_set(&cmd->t_task_cdbs_ex_left, 1);
-
 	/*
 	 * For WRITEs, let the fabric know its buffer is ready.
 	 *
Index: lio-core/include/target/target_core_base.h
===================================================================
--- lio-core.orig/include/target/target_core_base.h	2012-04-24 06:10:38.572372875 +0200
+++ lio-core/include/target/target_core_base.h	2012-04-24 06:11:36.924374369 +0200
@@ -549,7 +549,6 @@ struct se_cmd {
 	unsigned long long	t_task_lba;
 	atomic_t		t_fe_count;
 	atomic_t		t_se_count;
-	atomic_t		t_task_cdbs_ex_left;
 	unsigned int		transport_state;
 #define CMD_T_ABORTED		(1 << 0)
 #define CMD_T_ACTIVE		(1 << 1)

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