Now that the queue is flag as having an actual profile or not, avoid calling into the integrity code unless we have one. This removes some overhead from blk_mq_submit_bio() if BLK_DEV_INTEGRITY is enabled and we don't have any profiles attached, which is the default and expected case. Signed-off-by: Jens Axboe <axboe@xxxxxxxxx> --- block/blk-mq.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/block/blk-mq.c b/block/blk-mq.c index 37268656aae9..965e42a1bbde 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -2961,7 +2961,8 @@ bool blk_mq_submit_bio(struct bio *bio) bio_set_ioprio(bio); - if (!bio_integrity_prep(bio)) + if (test_bit(QUEUE_FLAG_INTG_PROFILE, &q->queue_flags) && + !bio_integrity_prep(bio)) return false; if (plug) { -- 2.43.0