@@ -691,6 +691,8 @@ static void blk_mq_finish_request(struct request *rq)
{
struct request_queue *q = rq->q;
+ blk_zone_finish_request(rq);
+
if (rq->rq_flags & RQF_USE_SCHED) {
q->elevator->type->ops.finish_request(rq);
/*
@@ -828,8 +830,6 @@ static void blk_complete_request(struct request *req)
bio = next;
} while (bio);
- blk_zone_complete_request(req);
-
/*
* Reset counters so that the request stacking driver
* can find how many bytes remain in the request
@@ -940,7 +940,6 @@ bool blk_update_request(struct request *req, blk_status_t error,
* completely done
*/
if (!req->bio) {
- blk_zone_complete_request(req);
/*
* Reset counters so that the request stacking driver
* can find how many bytes remain in the request
@@ -2996,7 +2995,6 @@ void blk_mq_submit_bio(struct bio *bio)
if (ret != BLK_STS_OK) {
bio->bi_status = ret;
bio_endio(bio);
- blk_zone_complete_request(rq);
blk_mq_free_request(rq);
return;
}
@@ -531,7 +531,7 @@ static inline bool disk_should_remove_zone_wplug(struct gendisk *disk,
/*
* Completions of BIOs with blk_zone_write_plug_bio_endio() may
* happen after handling a request completion with
- * blk_zone_write_plug_complete_request() (e.g. with split BIOs
+ * blk_zone_write_plug_finish_request() (e.g. with split BIOs
* that are chained). In such case, disk_zone_wplug_unplug_bio()
* should not attempt to remove the zone write plug until all BIO
* completions are seen. Check by looking at the zone write plug
@@ -921,7 +921,7 @@ void blk_zone_write_plug_init_request(struct request *req)
/*
* Indicate that completion of this request needs to be handled with
- * blk_zone_write_plug_complete_request(), which will drop the reference
+ * blk_zone_write_plug_finish_request(), which will drop the reference
* on the zone write plug we took above on entry to this function.
*/
req->rq_flags |= RQF_ZONE_WRITE_PLUGGING;
@@ -1255,7 +1255,7 @@ void blk_zone_write_plug_bio_endio(struct bio *bio)
disk_put_zone_wplug(zwplug);
/*
- * For BIO-based devices, blk_zone_write_plug_complete_request()
+ * For BIO-based devices, blk_zone_write_plug_finish_request()
* is not called. So we need to schedule execution of the next
* plugged BIO here.
*/
@@ -1266,11 +1266,12 @@ void blk_zone_write_plug_bio_endio(struct bio *bio)
disk_put_zone_wplug(zwplug);
}
-void blk_zone_write_plug_complete_request(struct request *req)
+void blk_zone_write_plug_finish_request(struct request *req)
{
struct gendisk *disk = req->q->disk;
- struct blk_zone_wplug *zwplug = disk_get_zone_wplug(disk, req->__sector);
+ struct blk_zone_wplug *zwplug;
+ zwplug = disk_get_zone_wplug(disk, req->__sector);
if (WARN_ON_ONCE(!zwplug))
return;
@@ -453,11 +453,11 @@ static inline void blk_zone_bio_endio(struct bio *bio)
blk_zone_write_plug_bio_endio(bio);
}
-void blk_zone_write_plug_complete_request(struct request *rq);
-static inline void blk_zone_complete_request(struct request *rq)
+void blk_zone_write_plug_finish_request(struct request *rq);
+static inline void blk_zone_finish_request(struct request *rq)
{
if (rq->rq_flags & RQF_ZONE_WRITE_PLUGGING)
- blk_zone_write_plug_complete_request(rq);
+ blk_zone_write_plug_finish_request(rq);
}
int blkdev_report_zones_ioctl(struct block_device *bdev, unsigned int cmd,
unsigned long arg);
@@ -491,7 +491,7 @@ static inline void blk_zone_update_request_bio(struct request *rq,
static inline void blk_zone_bio_endio(struct bio *bio)
{
}
-static inline void blk_zone_complete_request(struct request *rq)
+static inline void blk_zone_finish_request(struct request *rq)
{
}
static inline int blkdev_report_zones_ioctl(struct block_device *bdev,