diff options
author | Christoph Hellwig <hch@lst.de> | 2024-11-13 18:20:44 +0300 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2024-11-13 22:04:58 +0300 |
commit | a3396b99990d8b4e5797e7b16fdeb64c15ae97bb (patch) | |
tree | ab6c55dedd8af72f1206f90c63a1331cf08b3f1f /drivers/block/null_blk/main.c | |
parent | e8225ab15006fbcdb14cef426a0a54475292fbbc (diff) | |
download | linux-a3396b99990d8b4e5797e7b16fdeb64c15ae97bb.tar.xz |
block: add a rq_list type
Replace the semi-open coded request list helpers with a proper rq_list
type that mirrors the bio_list and has head and tail pointers. Besides
better type safety this actually allows to insert at the tail of the
list, which will be useful soon.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20241113152050.157179-5-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'drivers/block/null_blk/main.c')
-rw-r--r-- | drivers/block/null_blk/main.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/block/null_blk/main.c b/drivers/block/null_blk/main.c index 2f0431e42c49..3c3d8d200abb 100644 --- a/drivers/block/null_blk/main.c +++ b/drivers/block/null_blk/main.c @@ -1638,10 +1638,9 @@ static blk_status_t null_queue_rq(struct blk_mq_hw_ctx *hctx, return BLK_STS_OK; } -static void null_queue_rqs(struct request **rqlist) +static void null_queue_rqs(struct rq_list *rqlist) { - struct request *requeue_list = NULL; - struct request **requeue_lastp = &requeue_list; + struct rq_list requeue_list = {}; struct blk_mq_queue_data bd = { }; blk_status_t ret; @@ -1651,8 +1650,8 @@ static void null_queue_rqs(struct request **rqlist) bd.rq = rq; ret = null_queue_rq(rq->mq_hctx, &bd); if (ret != BLK_STS_OK) - rq_list_add_tail(&requeue_lastp, rq); - } while (!rq_list_empty(*rqlist)); + rq_list_add_tail(&requeue_list, rq); + } while (!rq_list_empty(rqlist)); *rqlist = requeue_list; } |