diff options
author | Christoph Hellwig <hch@infradead.org> | 2009-09-30 07:54:20 -0400 |
---|---|---|
committer | Jens Axboe <jens.axboe@oracle.com> | 2009-10-01 15:19:34 -0400 |
commit | 67efc9258010da35b27b3854d0880c7e193004ed (patch) | |
tree | d98ad032d8c701084539d5673c2d7d7ca5962a3f /block/blk-core.c | |
parent | c15227de132f1295f3db6b7df9079956b1020fd8 (diff) |
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>
Diffstat (limited to 'block/blk-core.c')
-rw-r--r-- | block/blk-core.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index 80a020dd1580..34504f309728 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -1436,7 +1436,8 @@ static inline void __generic_make_request(struct bio *bio) | |||
1436 | goto end_io; | 1436 | goto end_io; |
1437 | } | 1437 | } |
1438 | 1438 | ||
1439 | if (unlikely(nr_sectors > queue_max_hw_sectors(q))) { | 1439 | if (unlikely(!bio_rw_flagged(bio, BIO_RW_DISCARD) && |
1440 | nr_sectors > queue_max_hw_sectors(q))) { | ||
1440 | printk(KERN_ERR "bio too big device %s (%u > %u)\n", | 1441 | printk(KERN_ERR "bio too big device %s (%u > %u)\n", |
1441 | bdevname(bio->bi_bdev, b), | 1442 | bdevname(bio->bi_bdev, b), |
1442 | bio_sectors(bio), | 1443 | bio_sectors(bio), |