]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
blk-integrity: take const pointer in blk_integrity_rq()
authorCaleb Sander Mateos <csander@purestorage.com>
Thu, 8 Jan 2026 09:19:29 +0000 (02:19 -0700)
committerJens Axboe <axboe@kernel.dk>
Mon, 12 Jan 2026 16:15:05 +0000 (09:15 -0700)
blk_integrity_rq() doesn't modify the struct request passed in, so allow
a const pointer to be passed. Use a matching signature for the
!CONFIG_BLK_DEV_INTEGRITY version.

Signed-off-by: Caleb Sander Mateos <csander@purestorage.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/blk-integrity.h

index a6b84206eb94cc4ab5ac5a7f5decd25958d32385..c15b1ac627650d4dae255c0a5cf30489e7bfe433 100644 (file)
@@ -91,7 +91,7 @@ static inline unsigned int bio_integrity_bytes(struct blk_integrity *bi,
        return bio_integrity_intervals(bi, sectors) * bi->metadata_size;
 }
 
-static inline bool blk_integrity_rq(struct request *rq)
+static inline bool blk_integrity_rq(const struct request *rq)
 {
        return rq->cmd_flags & REQ_INTEGRITY;
 }
@@ -168,9 +168,9 @@ static inline unsigned int bio_integrity_bytes(struct blk_integrity *bi,
 {
        return 0;
 }
-static inline int blk_integrity_rq(struct request *rq)
+static inline bool blk_integrity_rq(const struct request *rq)
 {
-       return 0;
+       return false;
 }
 
 static inline struct bio_vec rq_integrity_vec(struct request *rq)