Re: [PATCH] target: Convert ->transport_wait_for_tasks usage to transport_generic_free_cmd

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

 



On Sun, 2011-10-09 at 08:28 +0000, Nicholas A. Bellinger wrote:
> From: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> 
> This patch converts se_cmd->transport_wait_for_tasks(se_cmd, 1) usage to use
> transport_generic_free_cmd() directly in target-core and iscsi-target fabric
> usage.  The includes:
> 
> *) Removal of the optional transport_generic_free_cmd() call from within
>    transport_generic_wait_for_tasks()
> *) Usage of existing SCF_SUPPORTED_SAM_OPCODE to determine when
>    transport_generic_wait_for_tasks() processing may occur instead of
>    checking se_cmd->transport_wait_for_tasks()
> *) Move transport_generic_wait_for_tasks() call ahead of core_dec_lacl_count()
>    and transport_lun_remove_cmd() in transport_generic_free_cmd() to follow
>    existing logic for iscsi-target w/ se_cmd->transport_wait_for_tasks(se_cmd, 1)
> *) Removal of se_cmd->transport_wait_for_tasks() function pointer
> *) Add EXPORT_SYMBOL for transport_generic_wait_for_tasks()
> 
> For the case in iscsi_target_erl2.c:iscsit_prepare_cmds_for_realligance()
> where se_cmd->transport_wait_for_tasks(se_cmd, 0) is called, this patch
> adds a direct call to transport_generic_wait_for_tasks().
> 
> Reported-by: Christoph Hellwig <hch@xxxxxx>
> Cc: Christoph Hellwig <hch@xxxxxx>
> Signed-off-by: Nicholas Bellinger <nab@xxxxxxxxxxxxxxx>
> ---
>  drivers/target/iscsi/iscsi_target.c      |   12 +----
>  drivers/target/iscsi/iscsi_target_erl2.c |   41 ++++++------------
>  drivers/target/target_core_transport.c   |   65 ++++++++++--------------------
>  include/target/target_core_base.h        |    1 -
>  include/target/target_core_transport.h   |    1 +
>  5 files changed, 39 insertions(+), 81 deletions(-)
> 

<SNIP>

> @@ -4555,8 +4535,10 @@ static void transport_generic_wait_for_tasks(
>  		atomic_set(&cmd->transport_lun_stop, 0);
>  	}
>  	if (!atomic_read(&cmd->t_transport_active) ||
> -	     atomic_read(&cmd->t_transport_aborted))
> -		goto remove;
> +	     atomic_read(&cmd->t_transport_aborted)) {
> +		spin_unlock_irqrestore(&cmd->t_state_lock, flags);
> +		return;
> +	}
>  
>  	atomic_set(&cmd->t_transport_stop, 1);
>  
> @@ -4579,13 +4561,8 @@ static void transport_generic_wait_for_tasks(
>  	pr_debug("wait_for_tasks: Stopped wait_for_compltion("
>  		"&cmd->t_transport_stop_comp) for ITT: 0x%08x\n",
>  		cmd->se_tfo->get_task_tag(cmd));
> -remove:
> -	spin_unlock_irqrestore(&cmd->t_state_lock, flags);
> -	if (!remove_cmd)
> -		return;
> -
> -	transport_generic_free_cmd(cmd, 0);
>  }
> +EXPORT_SYMBOL(transport_generic_wait_for_tasks);
>  

Readding the incorrectly dropped cmd->t_state_lock unlock from above..

--nab

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