]> git.baikalelectronics.ru Git - kernel.git/commit
block: allow large discard requests
authorChristoph Hellwig <hch@infradead.org>
Wed, 30 Sep 2009 11:54:20 +0000 (13:54 +0200)
committerJens Axboe <jens.axboe@oracle.com>
Thu, 1 Oct 2009 19:19:34 +0000 (21:19 +0200)
commit238ae3a3b89d96c2dcf384d51456a9b91c42dc96
treed98ad032d8c701084539d5673c2d7d7ca5962a3f
parent575dfbdb9f03bac299cbd7467b7fbd0a431f62ad
block: allow large discard requests

Currently we set the bio size to the byte equivalent of the blocks to
be trimmed when submitting the initial DISCARD ioctl.  That means it
is subject to the max_hw_sectors limitation of the HBA which is
much lower than the size of a DISCARD request we can support.
Add a separate max_discard_sectors tunable to limit the size for discard
requests.

We limit the max discard request size in bytes to 32bit as that is the
limit for bio->bi_size.  This could be much larger if we had a way to pass
that information through the block layer.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
block/blk-barrier.c
block/blk-core.c
block/blk-settings.c
include/linux/blkdev.h