[PATCH 3/3] block: only call bio_integrity_prep() if necessary

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux