]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
block: make max_integrity_io_size public
authorChristoph Hellwig <hch@lst.de>
Mon, 23 Feb 2026 13:20:05 +0000 (05:20 -0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Mar 2026 13:47:02 +0000 (07:47 -0600)
File systems that generate integrity will need this, so move it out
of the block private or blk-mq specific headers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Anuj Gupta <anuj20.g@samsung.com>
Reviewed-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Tested-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-settings.c
include/linux/blk-integrity.h
include/linux/blkdev.h

index a9e65dc090dae886c2ef4e45e3d9c682f663ce50..dabfab97fbab0a5b570fe5e4dae3dabb74e43dea 100644 (file)
@@ -123,19 +123,6 @@ static int blk_validate_zoned_limits(struct queue_limits *lim)
        return 0;
 }
 
-/*
- * Maximum size of I/O that needs a block layer integrity buffer.  Limited
- * by the number of intervals for which we can fit the integrity buffer into
- * the buffer size.  Because the buffer is a single segment it is also limited
- * by the maximum segment size.
- */
-static inline unsigned int max_integrity_io_size(struct queue_limits *lim)
-{
-       return min_t(unsigned int, lim->max_segment_size,
-               (BLK_INTEGRITY_MAX_SIZE / lim->integrity.metadata_size) <<
-                       lim->integrity.interval_exp);
-}
-
 static int blk_validate_integrity_limits(struct queue_limits *lim)
 {
        struct blk_integrity *bi = &lim->integrity;
index fd3f3c8c0fcd6460908e71bad9988710d67d4a10..ea6d7d322ae3bb0984f0be91a816408364751d2f 100644 (file)
@@ -8,11 +8,6 @@
 
 struct request;
 
-/*
- * Maximum contiguous integrity buffer allocation.
- */
-#define BLK_INTEGRITY_MAX_SIZE         SZ_2M
-
 enum blk_integrity_flags {
        BLK_INTEGRITY_NOVERIFY          = 1 << 0,
        BLK_INTEGRITY_NOGENERATE        = 1 << 1,
index dec0acaed6e6bf6b7a17a82178a3fbdc4790f88a..11857ae13d1040f6aa3012009f82b50f46274f17 100644 (file)
@@ -1881,6 +1881,24 @@ static inline int bio_split_rw_at(struct bio *bio,
        return bio_split_io_at(bio, lim, segs, max_bytes, lim->dma_alignment);
 }
 
+/*
+ * Maximum contiguous integrity buffer allocation.
+ */
+#define BLK_INTEGRITY_MAX_SIZE         SZ_2M
+
+/*
+ * Maximum size of I/O that needs a block layer integrity buffer.  Limited
+ * by the number of intervals for which we can fit the integrity buffer into
+ * the buffer size.  Because the buffer is a single segment it is also limited
+ * by the maximum segment size.
+ */
+static inline unsigned int max_integrity_io_size(struct queue_limits *lim)
+{
+       return min_t(unsigned int, lim->max_segment_size,
+               (BLK_INTEGRITY_MAX_SIZE / lim->integrity.metadata_size) <<
+                       lim->integrity.interval_exp);
+}
+
 #define DEFINE_IO_COMP_BATCH(name)     struct io_comp_batch name = { }
 
 #endif /* _LINUX_BLKDEV_H */