Re: [PATCH] blk-mq: remove the bio argument to ->prepare_request

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Christoph,

On 5/16/20 6:13 PM, Christoph Hellwig wrote:
On Sat, May 16, 2020 at 09:12:10AM -0700, Bart Van Assche wrote:
On 2020-05-16 08:40, Christoph Hellwig wrote:
None of the I/O schedulers actually needs it.
Is the next step perhaps to remove the bio argument from
blk_mq_get_request()? Anyway:
Yes, but that is a bigger surgery :)

I had local changes for it which was compiled test, and seems no new caller of blk_mq_get_request.

commit f888e1aa2cd2480ecc80bd67df5b5d3301408ac8
Author: Guoqing Jiang <guoqing.jiang@xxxxxxxxxxxxxxx>
Date:   Tue Mar 24 15:11:38 2020 +0100

    blk-mq: remove unused argument from blk_mq_get_request

    We can remove 'bio' from blk_mq_get_request as well since
    prepare_request doesn't need it anymore.

    Signed-off-by: Guoqing Jiang <guoqing.jiang@xxxxxxxxxxxxxxx>

diff --git a/block/blk-mq.c b/block/blk-mq.c
index 6a1725f7c319..a74c7710fc7d 100644
--- a/block/blk-mq.c
+++ b/block/blk-mq.c
@@ -332,7 +332,6 @@ static struct request *blk_mq_rq_ctx_init(struct blk_mq_alloc_data *data,
 }

 static struct request *blk_mq_get_request(struct request_queue *q,
-                                         struct bio *bio,
                                          struct blk_mq_alloc_data *data)
 {
        struct elevator_queue *e = q->elevator;
@@ -408,7 +407,7 @@ struct request *blk_mq_alloc_request(struct request_queue *q, unsigned int op,
        if (ret)
                return ERR_PTR(ret);

-       rq = blk_mq_get_request(q, NULL, &alloc_data);
+       rq = blk_mq_get_request(q, &alloc_data);
        blk_queue_exit(q);

        if (!rq)
@@ -457,7 +456,7 @@ struct request *blk_mq_alloc_request_hctx(struct request_queue *q,
        cpu = cpumask_first_and(alloc_data.hctx->cpumask, cpu_online_mask);
        alloc_data.ctx = __blk_mq_get_ctx(q, cpu);

-       rq = blk_mq_get_request(q, NULL, &alloc_data);
+       rq = blk_mq_get_request(q, &alloc_data);
        blk_queue_exit(q);

        if (!rq)
@@ -1988,7 +1987,7 @@ static blk_qc_t blk_mq_make_request(struct request_queue *q, struct bio *bio)
        rq_qos_throttle(q, bio);

        data.cmd_flags = bio->bi_opf;
-       rq = blk_mq_get_request(q, bio, &data);
+       rq = blk_mq_get_request(q, &data);
        if (unlikely(!rq)) {
                rq_qos_cleanup(q, bio);
                if (bio->bi_opf & REQ_NOWAIT)

Thanks,
Guoqing



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux