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

Submitted by Vasily Averin on Sept. 4, 2020, 7:30 a.m.

Details

Message ID 202009040730.0847Uhtr024642@vz7build.vvs.sw.ru
State New
Series "ploop: Rework queue_settings autoconfig and allow fuse 4K discard"
Headers show

Commit Message

Vasily Averin Sept. 4, 2020, 7:30 a.m.
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@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@virtuozzo.com>
---
 drivers/block/ploop/dev.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

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;