]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
block: rename min_segment_size
authorKeith Busch <kbusch@kernel.org>
Mon, 20 Oct 2025 20:47:15 +0000 (13:47 -0700)
committerJens Axboe <axboe@kernel.dk>
Wed, 22 Oct 2025 13:39:39 +0000 (07:39 -0600)
Despite its name, the block layer is fine with segments smaller that the
"min_segment_size" limit. The value is an optimization limit indicating
the largest segment that can be used without considering boundary
limits. Smaller segments can take a fast path, so give it a name that
reflects that: max_fast_segment_size.

Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
block/blk-merge.c
block/blk-settings.c
block/blk.h
include/linux/blkdev.h

index 37864c5d287ef8b63580348e49165a0c4dd95043..c47d18587a0b6eddaab098a8cca30077670eb3a3 100644 (file)
@@ -336,7 +336,7 @@ int bio_split_io_at(struct bio *bio, const struct queue_limits *lim,
 
                if (nsegs < lim->max_segments &&
                    bytes + bv.bv_len <= max_bytes &&
-                   bv.bv_offset + bv.bv_len <= lim->min_segment_size) {
+                   bv.bv_offset + bv.bv_len <= lim->max_fast_segment_size) {
                        nsegs++;
                        bytes += bv.bv_len;
                } else {
index 54cffaae4df49e041bf8d0bdbc85d35abc2870a6..345b6a271cc35d487dc146540efee11ea12e0e29 100644 (file)
@@ -457,12 +457,12 @@ int blk_validate_limits(struct queue_limits *lim)
                        return -EINVAL;
        }
 
-       /* setup min segment size for building new segment in fast path */
+       /* setup max segment size for building new segment in fast path */
        if (lim->seg_boundary_mask > lim->max_segment_size - 1)
                seg_size = lim->max_segment_size;
        else
                seg_size = lim->seg_boundary_mask + 1;
-       lim->min_segment_size = min_t(unsigned int, seg_size, PAGE_SIZE);
+       lim->max_fast_segment_size = min_t(unsigned int, seg_size, PAGE_SIZE);
 
        /*
         * We require drivers to at least do logical block aligned I/O, but
index 170794632135dab5c91f5d5c599312de3667c9b3..32a10024efbaaf5b4764b2f4be8bca0531c9152f 100644 (file)
@@ -377,7 +377,7 @@ static inline bool bio_may_need_split(struct bio *bio,
        if (bio->bi_vcnt != 1)
                return true;
        return bio->bi_io_vec->bv_len + bio->bi_io_vec->bv_offset >
-               lim->min_segment_size;
+               lim->max_fast_segment_size;
 }
 
 /**
index 70b671a9a7f77573843309dbd5db886c119293b3..99be263b31ab5bb7e8e653989652ffca27f69561 100644 (file)
@@ -378,7 +378,7 @@ struct queue_limits {
        unsigned int            max_sectors;
        unsigned int            max_user_sectors;
        unsigned int            max_segment_size;
-       unsigned int            min_segment_size;
+       unsigned int            max_fast_segment_size;
        unsigned int            physical_block_size;
        unsigned int            logical_block_size;
        unsigned int            alignment_offset;