[Devel] [PATCH RHEL7 COMMIT] ploop: Move blk_queue_make_request() into __ploop_dev_alloc()

Vasily Averin vvs at virtuozzo.com
Fri Sep 4 10:30:43 MSK 2020


The commit is pushed to "branch-rh7-3.10.0-1127.18.2.vz7.163.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-1127.18.2.vz7.163.16
------>
commit a55b541248a7402060884159d3a2b9f154afb267
Author: Kirill Tkhai <ktkhai at virtuozzo.com>
Date:   Fri Sep 4 10:30:43 2020 +0300

    ploop: Move blk_queue_make_request() into __ploop_dev_alloc()
    
    We have no more make_request functions except ploop_make_request(),
    so it looks sane to place its assignment into device creation
    function.
    
    The only thing we extract from blk_queue_make_request() is
    queue defaults assignment. It will be called before every
    ->queue_settings().
    
    https://jira.sw.ru/browse/PSBM-107598
    Signed-off-by: Kirill Tkhai <ktkhai at virtuozzo.com>
---
 drivers/block/ploop/dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/block/ploop/dev.c b/drivers/block/ploop/dev.c
index d999bff..07226e7 100644
--- a/drivers/block/ploop/dev.c
+++ b/drivers/block/ploop/dev.c
@@ -4206,7 +4206,6 @@ static int ploop_start(struct ploop_device * plo, struct block_device *bdev)
 	/* Deltas are ready. Enable block device. */
 	set_device_ro(bdev, (top_delta->flags & PLOOP_FMT_RDONLY) != 0);
 
-	blk_queue_make_request(q, ploop_make_request);
 	q->queuedata = plo;
 	q->backing_dev_info.congested_fn = ploop_congested;
 	q->backing_dev_info.congested_fn2 = ploop_congested2;
@@ -4217,6 +4216,7 @@ static int ploop_start(struct ploop_device * plo, struct block_device *bdev)
 	blk_queue_flush(q, REQ_FLUSH);
 
 	plo->force_split_discard_reqs = false;
+	blk_set_default_limits(&q->limits);
 	top_delta->io.ops->queue_settings(&top_delta->io, q);
 	/* REQ_WRITE_SAME is not supported */
 	blk_queue_max_write_same_sectors(q, 0);
@@ -5617,6 +5617,8 @@ static struct ploop_device *__ploop_dev_alloc(int index)
 	if (!plo->disk)
 		goto out_queue;
 
+	blk_queue_make_request(plo->queue, ploop_make_request);
+
 	spin_lock_init(&plo->lock);
 	spin_lock_init(&plo->dummy_lock);
 	plo->queue->queue_lock = &plo->dummy_lock;


More information about the Devel mailing list