use_sg != 0 assumption (was Re: [PATCH 5/9] Drop single buffer request support.)

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

 



Kristian Høgsberg wrote:
> The SCSI layer only passes sg requests down, so drop the
> use_sg == 0, request_bufflen != 0 case.
> 
> Signed-off-by: Kristian Hoegsberg <krh@xxxxxxxxxx>
> ---
>  drivers/firewire/fw-sbp2.c |   43 +------------------------------------------
>  1 files changed, 1 insertions(+), 42 deletions(-)

[...]

> @@ -1063,21 +1035,8 @@ static int sbp2_scsi_queuecommand(struct scsi_cmnd *cmd, scsi_done_fn_t done)
>  		orb->request.misc |=
>  			COMMAND_ORB_DIRECTION(SBP2_DIRECTION_TO_MEDIA);
>  
> -	if (cmd->use_sg) {
> -		if (sbp2_command_orb_map_scatterlist(orb) < 0)
> -			goto fail_map_payload;
> -	} else if (cmd->request_bufflen > SBP2_MAX_SG_ELEMENT_LENGTH) {
> -		/*
> -		 * FIXME: Need to split this into a sg list... but
> -		 * could we get the scsi or blk layer to do that by
> -		 * reporting our max supported block size?
> -		 */
> -		fw_error("command > 64k\n");
> +	if (cmd->use_sg && sbp2_command_orb_map_scatterlist(orb) < 0)
>  		goto fail_map_payload;
> -	} else if (cmd->request_bufflen > 0) {
> -		if (sbp2_command_orb_map_buffer(orb) < 0)
> -			goto fail_map_payload;
> -	}
>  
>  	fw_memcpy_to_be32(&orb->request, &orb->request, sizeof orb->request);
>  

Would a BUG_ON(cmd->use_sg == 0); be in order?
-- 
Stefan Richter
-=====-=-=== -=-= -=-=-
http://arcgraph.de/sr/
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]
  Powered by Linux