Re: Maximum data size in a single transfer for MS driver

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

 



On Thu, 25 Feb 2010, Martin K. Petersen wrote:

> >>>>> "mkp" == Martin K Petersen <martin.petersen@xxxxxxxxxx> writes:
> 
> mkp> This one is a runt that came in as part of the DM topology
> mkp> enablement.  DM ended up doing things differently and it is no
> mkp> longer used.  I already have a patch in my queue that removes it.
> 
> Here it is, btw...
> 
> 
> block: Remove blk_queue_max_hw_sectors
> 
> This function is no longer called by any subsystem and can be removed.
> 
> Also clarify test in blk_queue_max_sectors.
> 
> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx>
> 
> ---
> 
> diff --git a/block/blk-settings.c b/block/blk-settings.c
> index aaa379b..69b7c67 100644
> --- a/block/blk-settings.c
> +++ b/block/blk-settings.c
> @@ -226,7 +226,7 @@ void blk_queue_max_sectors(struct request_queue *q, unsigned int max_sectors)
>  		       __func__, max_sectors);
>  	}
>  
> -	if (BLK_DEF_MAX_SECTORS > max_sectors)
> +	if (max_sectors < BLK_DEF_MAX_SECTORS)
>  		q->limits.max_hw_sectors = q->limits.max_sectors = max_sectors;
>  	else {
>  		q->limits.max_sectors = BLK_DEF_MAX_SECTORS;

Why is max_sectors changed?  If it is already smaller than the new 
value of max_hw_sectors, shouldn't it remain the same?

Or to put it another way, shouldn't the code look more like this?

	q->limits.max_hw_sectors = max(max_sectors, BLK_DEF_MAX_SECTORS);
	if (q->limits.max_sectors > q->limits.max_hw_sectors)
		q->limits.max_sectors = q->limits.max_hw_sectors;

Alan Stern

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