block: optionally merge discontiguous discard bios into a single request
authorChristoph Hellwig <hch@lst.de>
Wed, 8 Feb 2017 13:46:49 +0000 (14:46 +0100)
committerJens Axboe <axboe@fb.com>
Wed, 8 Feb 2017 20:43:08 +0000 (13:43 -0700)
commit1e739730c5b9ea80a2f25e9cf6e1025d47e3d8ed
tree4f48ed6c92153fb9941185182e918232eb3472f4
parent34fe7c05400663e01e23cddd1fea68bb7a2b3d29
block: optionally merge discontiguous discard bios into a single request

Add a new merge strategy that merges discard bios into a request until the
maximum number of discard ranges (or the maximum discard size) is reached
from the plug merging code.  I/O scheduler merging is not wired up yet
but might also be useful, although not for fast devices like NVMe which
are the only user for now.

Note that for now we don't support limiting the size of each discard range,
but if needed that can be added later.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jens Axboe <axboe@fb.com>
block/blk-core.c
block/blk-merge.c
block/blk-mq.c
block/blk-settings.c
block/blk-sysfs.c
block/blk.h
include/linux/blkdev.h
include/linux/elevator.h