]> git.baikalelectronics.ru Git - kernel.git/commit
block: Improve zone reset execution
authorDamien Le Moal <damien.lemoal@wdc.com>
Fri, 12 Oct 2018 10:08:47 +0000 (19:08 +0900)
committerJens Axboe <axboe@kernel.dk>
Thu, 25 Oct 2018 17:17:40 +0000 (11:17 -0600)
commit560d36a2fd78063363f186b64e64f40421a6398f
treed099578f43e9d1136c792485f4231a7fe1dc71b3
parent75f7527bd720f2a1b4ee5d6236ad08734576105b
block: Improve zone reset execution

There is no need to synchronously execute all REQ_OP_ZONE_RESET BIOs
necessary to reset a range of zones. Similarly to what is done for
discard BIOs in blk-lib.c, all zone reset BIOs can be chained and
executed asynchronously and a synchronous call done only for the last
BIO of the chain.

Modify blkdev_reset_zones() to operate similarly to
blkdev_issue_discard() using the next_bio() helper for chaining BIOs. To
avoid code duplication of that function in blk_zoned.c, rename
next_bio() into blk_next_bio() and declare it as a block internal
function in blk.h.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Signed-off-by: Damien Le Moal <damien.lemoal@wdc.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-lib.c
block/blk-zoned.c
block/blk.h