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

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

 



BLK_DEF_MAX_SECTORS seems to act as a cap, as a MAXIMUM possible value for
q->limits->max_sectors in blk_queue_max_sectors,
but as a MINIMUM for q->limits.max_hw_sectors in blk_queue_max_hw_sectors.

Is that intentional?

Is this code in block/blk-settings.c correct?

void blk_queue_max_sectors(struct request_queue *q, unsigned int max_sectors)
{
        if ((max_sectors << 9) < PAGE_CACHE_SIZE) {
                max_sectors = 1 << (PAGE_CACHE_SHIFT - 9);
                printk(KERN_INFO "%s: set to minimum %d\n",
                       __func__, max_sectors);
        }

        if (BLK_DEF_MAX_SECTORS > max_sectors)
                q->limits.max_hw_sectors = q->limits.max_sectors = max_sectors;
        else {
                q->limits.max_sectors = BLK_DEF_MAX_SECTORS;
                q->limits.max_hw_sectors = max_sectors;
        }
}
EXPORT_SYMBOL(blk_queue_max_sectors);

void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_sectors)
{
        if (BLK_DEF_MAX_SECTORS > max_sectors)
                q->limits.max_hw_sectors = BLK_DEF_MAX_SECTORS;
        else
                q->limits.max_hw_sectors = max_sectors;
}
EXPORT_SYMBOL(blk_queue_max_hw_sectors);


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