blk-mq: make the blk-mq stacking code optional
authorChristoph Hellwig <hch@lst.de>
Tue, 15 Feb 2022 10:05:36 +0000 (11:05 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 17 Feb 2022 02:39:09 +0000 (19:39 -0700)
The code to stack blk-mq drivers is only used by dm-multipath, and
will preferably stay that way.  Make it optional and only selected
by device mapper, so that the buildbots more easily catch abuses
like the one that slipped in in the ufs driver in the last merged
window.  Another positive side effects is that kernel builds without
device mapper shrink a little bit as well.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Mike Snitzer <snitzer@redhat.com>
Link: https://lore.kernel.org/r/20220215100540.3892965-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/Kconfig
block/blk-mq.c
drivers/md/Kconfig

index 205f8d01c69523d04d8aa0387d8039757c700101..168b873eb666d6ea8b104ced864910cb1681de0c 100644 (file)
@@ -230,6 +230,9 @@ config BLK_PM
 config BLOCK_HOLDER_DEPRECATED
        bool
 
+config BLK_MQ_STACKING
+       bool
+
 source "block/Kconfig.iosched"
 
 endif # BLOCK
index 6c59ffe765fde9f0dac44edeb64ef8653d108a0d..db62d34afb637af490df3a543751183f96ebef90 100644 (file)
@@ -2840,6 +2840,7 @@ void blk_mq_submit_bio(struct bio *bio)
                                blk_mq_try_issue_directly(rq->mq_hctx, rq));
 }
 
+#ifdef CONFIG_BLK_MQ_STACKING
 /**
  * blk_cloned_rq_check_limits - Helper function to check a cloned request
  *                              for the new queue limits
@@ -3017,6 +3018,7 @@ free_and_out:
        return -ENOMEM;
 }
 EXPORT_SYMBOL_GPL(blk_rq_prep_clone);
+#endif /* CONFIG_BLK_MQ_STACKING */
 
 /*
  * Steal bios from a request and add them to a bio list.
index b5ea378e66cb1c26dcc41118ac60a220143acadd..998a5cfdbc4e9485fbdc9d4bb0c438d32dbf42a1 100644 (file)
@@ -204,6 +204,7 @@ config BLK_DEV_DM
        tristate "Device mapper support"
        select BLOCK_HOLDER_DEPRECATED if SYSFS
        select BLK_DEV_DM_BUILTIN
+       select BLK_MQ_STACKING
        depends on DAX || DAX=n
        help
          Device-mapper is a low level volume manager.  It works by allowing