From a2d6b3a2d39005ab4d4a83481a7db092ebf0e9d6 Mon Sep 17 00:00:00 2001 From: Damien Le Moal Date: Fri, 12 Oct 2018 19:08:47 +0900 Subject: 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 Reviewed-by: Hannes Reinecke Signed-off-by: Damien Le Moal Signed-off-by: Jens Axboe --- block/blk.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'block/blk.h') diff --git a/block/blk.h b/block/blk.h index 3d2aecba96a4..93574baaa6b8 100644 --- a/block/blk.h +++ b/block/blk.h @@ -488,4 +488,6 @@ extern int blk_iolatency_init(struct request_queue *q); static inline int blk_iolatency_init(struct request_queue *q) { return 0; } #endif +struct bio *blk_next_bio(struct bio *bio, unsigned int nr_pages, gfp_t gfp); + #endif /* BLK_INTERNAL_H */ -- cgit v1.2.3