Re: [PATCH 08/12] tcm_fc: use target_execute_cmd

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

 



On Sun, 2012-07-08 at 15:58 -0400, Christoph Hellwig wrote:
> plain text document attachment (tcm-fc-use-target_execute_cmd)
> Defer the write processing to the internal to be able to use
> target_execute_cmd.  I'm not even entirely sure the calling code requires
> this due to the convoluted structure in libfc, but let's be safe for now.
> 
> Signed-off-by: Christoph Hellwig <hch@xxxxxx>
> 

Looks fine.  Adding a little more to the comment, and CC'ing MDR for
good measure.

> ---
>  drivers/target/tcm_fc/tfc_io.c |   13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> Index: lio-core/drivers/target/tcm_fc/tfc_io.c
> ===================================================================
> --- lio-core.orig/drivers/target/tcm_fc/tfc_io.c	2012-07-01 14:29:04.400928679 +0200
> +++ lio-core/drivers/target/tcm_fc/tfc_io.c	2012-07-01 14:29:37.147595150 +0200
> @@ -183,6 +183,13 @@ int ft_queue_data_in(struct se_cmd *se_c
>  	return ft_queue_status(se_cmd);
>  }
>  
> +static void ft_execute_work(struct work_struct *work)
> +{
> +	struct ft_cmd *cmd = container_of(work, struct ft_cmd, work);
> +
> +	target_execute_cmd(&cmd->se_cmd);
> +}
> +
>  /*
>   * Receive write data frame.
>   */
> @@ -307,8 +314,10 @@ void ft_recv_write_data(struct ft_cmd *c
>  		cmd->write_data_len += tlen;
>  	}
>  last_frame:
> -	if (cmd->write_data_len == se_cmd->data_length)
> -		transport_generic_handle_data(se_cmd);
> +	if (cmd->write_data_len == se_cmd->data_length) {
> +		INIT_WORK(&cmd->work, ft_execute_work);
> +		queue_work(cmd->sess->tport->tpg->workqueue, &cmd->work);
> +	}
>  drop:
>  	fc_frame_free(fp);
>  }
> 
> --
> 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


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