Skip to content

Commit

Permalink
blk-mq: make the blk-mq stacking code optional
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Christoph Hellwig authored and Jens Axboe committed Feb 17, 2022
1 parent f122d10 commit 248c793
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions block/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,9 @@ config BLK_PM
config BLOCK_HOLDER_DEPRECATED
bool

config BLK_MQ_STACKING
bool

source "block/Kconfig.iosched"

endif # BLOCK
2 changes: 2 additions & 0 deletions block/blk-mq.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -3017,6 +3018,7 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src,
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.
Expand Down
1 change: 1 addition & 0 deletions drivers/md/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 248c793

Please sign in to comment.