From: Keith Busch 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 aligned segment that can be used without considering segment boundary limits, so give it a name that reflects that. Signed-off-by: Keith Busch --- block/blk-merge.c | 2 +- block/blk-settings.c | 4 ++-- block/blk.h | 2 +- include/linux/blkdev.h | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/block/blk-merge.c b/block/blk-merge.c index 70d704615be52..863a4a6d3da62 100644 --- a/block/blk-merge.c +++ b/block/blk-merge.c @@ -307,7 +307,7 @@ int bio_split_rw_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_aligned_segment) { nsegs++; bytes += bv.bv_len; } else { diff --git a/block/blk-settings.c b/block/blk-settings.c index d6438e6c276dc..a61d676ff4c49 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -442,12 +442,12 @@ int blk_validate_limits(struct queue_limits *lim) return -EINVAL; } - /* setup min segment size for building new segment in fast path */ + /* setup max aligned 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_aligned_segment = min_t(unsigned int, seg_size, PAGE_SIZE); /* * We require drivers to at least do logical block aligned I/O, but diff --git a/block/blk.h b/block/blk.h index 46f566f9b1266..ed60d3dcdf93c 100644 --- a/block/blk.h +++ b/block/blk.h @@ -376,7 +376,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_aligned_segment; } /** diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index fe1797bbec420..b8d4333716e59 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -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_aligned_segment; unsigned int physical_block_size; unsigned int logical_block_size; unsigned int alignment_offset; -- 2.47.3