Commit d6b9f4e6 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe

block: rename and document BLK_DEF_MAX_SECTORS

Give BLK_DEF_MAX_SECTORS a _CAP postfix and document what it is used for.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20231227092305.279567-5-hch@lst.deSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 3d77976c
...@@ -139,7 +139,7 @@ void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_secto ...@@ -139,7 +139,7 @@ void blk_queue_max_hw_sectors(struct request_queue *q, unsigned int max_hw_secto
if (limits->max_user_sectors) if (limits->max_user_sectors)
max_sectors = min(max_sectors, limits->max_user_sectors); max_sectors = min(max_sectors, limits->max_user_sectors);
else else
max_sectors = min(max_sectors, BLK_DEF_MAX_SECTORS); max_sectors = min(max_sectors, BLK_DEF_MAX_SECTORS_CAP);
max_sectors = round_down(max_sectors, max_sectors = round_down(max_sectors,
limits->logical_block_size >> SECTOR_SHIFT); limits->logical_block_size >> SECTOR_SHIFT);
......
...@@ -241,7 +241,7 @@ queue_max_sectors_store(struct request_queue *q, const char *page, size_t count) ...@@ -241,7 +241,7 @@ queue_max_sectors_store(struct request_queue *q, const char *page, size_t count)
if (max_sectors_kb == 0) { if (max_sectors_kb == 0) {
q->limits.max_user_sectors = 0; q->limits.max_user_sectors = 0;
max_sectors_kb = min(max_hw_sectors_kb, max_sectors_kb = min(max_hw_sectors_kb,
BLK_DEF_MAX_SECTORS >> 1); BLK_DEF_MAX_SECTORS_CAP >> 1);
} else { } else {
if (max_sectors_kb > max_hw_sectors_kb || if (max_sectors_kb > max_hw_sectors_kb ||
max_sectors_kb < page_kb) max_sectors_kb < page_kb)
......
...@@ -3500,7 +3500,7 @@ static int sd_revalidate_disk(struct gendisk *disk) ...@@ -3500,7 +3500,7 @@ static int sd_revalidate_disk(struct gendisk *disk)
} else { } else {
q->limits.io_opt = 0; q->limits.io_opt = 0;
rw_max = min_not_zero(logical_to_sectors(sdp, dev_max), rw_max = min_not_zero(logical_to_sectors(sdp, dev_max),
(sector_t)BLK_DEF_MAX_SECTORS); (sector_t)BLK_DEF_MAX_SECTORS_CAP);
} }
/* /*
......
...@@ -1056,7 +1056,14 @@ enum blk_default_limits { ...@@ -1056,7 +1056,14 @@ enum blk_default_limits {
BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL, BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL,
}; };
#define BLK_DEF_MAX_SECTORS 2560u /*
* Default upper limit for the software max_sectors limit used for
* regular file system I/O. This can be increased through sysfs.
*
* Not to be confused with the max_hw_sector limit that is entirely
* controlled by the driver, usually based on hardware limits.
*/
#define BLK_DEF_MAX_SECTORS_CAP 2560u
static inline unsigned long queue_segment_boundary(const struct request_queue *q) static inline unsigned long queue_segment_boundary(const struct request_queue *q)
{ {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment