The cbt_list field in struct request_queue only exists when
CONFIG_BLK_DEV_CBT is enabled. Guard the INIT_LIST_HEAD() call in
blk_alloc_queue() with the corresponding #ifdef to fix the build when
CONFIG_BLK_DEV_CBT is disabled.

Signed-off-by: Eva Kurchatova <[email protected]>

https://virtuozzo.atlassian.net/browse/VSTOR-134732
Feature: fix kunit
---
 block/blk-core.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/block/blk-core.c b/block/blk-core.c
index a168f2e41b7d..bcc3060de670 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -440,7 +440,9 @@ struct request_queue *blk_alloc_queue(struct queue_limits 
*lim, int node_id)
        init_waitqueue_head(&q->mq_freeze_wq);
        mutex_init(&q->mq_freeze_lock);
 
+#ifdef CONFIG_BLK_DEV_CBT
        INIT_LIST_HEAD(&q->cbt_list);
+#endif
 
        blkg_init_queue(q);
 
-- 
2.54.0

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to