Re: [PATCH 18/29] target/iscsi: built_r2ts_for_cmd cleanups

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

 



On Tue, 2012-04-03 at 15:51 -0700, Andy Grover wrote:
> change 3-val type param to bool - func only cares if type==2 or not.
> 
> use if/else rather than conditional operator ?: for clarity.
> 
> Signed-off-by: Andy Grover <agrover@xxxxxxxxxx>
> ---
>  drivers/target/iscsi/iscsi_target.c          |   44 ++++++++++++++------------
>  drivers/target/iscsi/iscsi_target.h          |    2 +-
>  drivers/target/iscsi/iscsi_target_configfs.c |    2 +-
>  drivers/target/iscsi/iscsi_target_erl1.c     |    2 +-
>  drivers/target/iscsi/iscsi_target_tmr.c      |    2 +-
>  5 files changed, 28 insertions(+), 24 deletions(-)
> 

<SNIP>

> @@ -2949,15 +2949,13 @@ static int iscsit_send_r2t(
>  }
>  
>  /*
> - *	type 0: Normal Operation.
> - *	type 1: Called from Storage Transport.
> - *	type 2: Called from iscsi_task_reassign_complete_write() for
> - *	        connection recovery.
> + *	@recovery: If called from iscsi_task_reassign_complete_write() for
> + *		connection recovery.
>   */
>  int iscsit_build_r2ts_for_cmd(
>  	struct iscsi_cmd *cmd,
>  	struct iscsi_conn *conn,
> -	int type)
> +	bool recovery)
>  {
>  	int first_r2t = 1;
>  	u32 offset = 0, xfer_len = 0;
> @@ -2968,27 +2966,33 @@ int iscsit_build_r2ts_for_cmd(
>  		return 0;
>  	}
>  
> -	if (conn->sess->sess_ops->DataSequenceInOrder && (type != 2))
> +	if (conn->sess->sess_ops->DataSequenceInOrder &&
> +	    !recovery)
>  		cmd->r2t_offset = max(cmd->r2t_offset, cmd->write_data_done);
>  
>  	while (cmd->outstanding_r2ts < conn->sess->sess_ops->MaxOutstandingR2T) {
>  		if (conn->sess->sess_ops->DataSequenceInOrder) {
>  			offset = cmd->r2t_offset;
>  
> -			if (first_r2t && (type == 2)) {
> -				xfer_len = ((offset +
> -					     (conn->sess->sess_ops->MaxBurstLength -
> -					     cmd->next_burst_len) >
> -					     cmd->data_length) ?
> -					    (cmd->data_length - offset) :
> -					    (conn->sess->sess_ops->MaxBurstLength -
> -					     cmd->next_burst_len));
> +			if (first_r2t && recovery) {
> +				int new_data_end = offset +
> +					conn->sess->sess_ops->MaxBurstLength -
> +					cmd->next_burst_len;
> +
> +				if (new_data_end > cmd->data_length)
> +					xfer_len = cmd->data_length - offset;
> +				else
> +					xfer_len = \
> +						conn->sess->sess_ops->MaxBurstLength -
> +						cmd->next_burst_len;

Removing the bogus '\' here..



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