Introduce a flag that indicates whether or not bio_split_to_limits() is called while processing a bio. Set this flag from inside blk_mq_alloc_queue() because bio_split_to_limits() is called for all request-based block drivers. This patch prepares for modifying when __submit_bio() calls blk_crypto_bio_prep(). Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx> --- block/blk-mq.c | 3 ++- include/linux/blkdev.h | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 532acdbe9e16..ab2fbc895a98 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -4411,7 +4411,8 @@ struct request_queue *blk_mq_alloc_queue(struct blk_mq_tag_set *set, if (!lim) lim = &default_lim; - lim->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT; + lim->features |= BLK_FEAT_IO_STAT | BLK_FEAT_NOWAIT | + BLK_FEAT_CALLS_BIO_SPLIT_TO_LIMITS; if (set->nr_maps > HCTX_TYPE_POLL) lim->features |= BLK_FEAT_POLL; diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index a51f92b6c340..108f70aa4d15 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -340,13 +340,17 @@ typedef unsigned int __bitwise blk_features_t; #define BLK_FEAT_ATOMIC_WRITES \ ((__force blk_features_t)(1u << 16)) +/* bio_split_to_limits() is called while processing a bio */ +#define BLK_FEAT_CALLS_BIO_SPLIT_TO_LIMITS ((__force blk_features_t)(1u << 17)) + /* * Flags automatically inherited when stacking limits. */ #define BLK_FEAT_INHERIT_MASK \ (BLK_FEAT_WRITE_CACHE | BLK_FEAT_FUA | BLK_FEAT_ROTATIONAL | \ BLK_FEAT_STABLE_WRITES | BLK_FEAT_ZONED | \ - BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE) + BLK_FEAT_RAID_PARTIAL_STRIPES_EXPENSIVE | \ + BLK_FEAT_CALLS_BIO_SPLIT_TO_LIMITS) /* internal flags in queue_limits.flags */ typedef unsigned int __bitwise blk_flags_t;