Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

block: make BLK_DEF_MAX_SECTORS unsigned

This is used as an unsigned value, so define it that way to avoid
having to cast it.

Suggested-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
Link: https://lore.kernel.org/r/20230105205146.3610282-2-kbusch@meta.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Keith Busch and committed by
Jens Axboe
0a26f327 1bd43e19

+4 -4
+1 -1
block/blk-settings.c
··· 135 135 limits->max_hw_sectors = max_hw_sectors; 136 136 137 137 max_sectors = min_not_zero(max_hw_sectors, limits->max_dev_sectors); 138 - max_sectors = min_t(unsigned int, max_sectors, BLK_DEF_MAX_SECTORS); 138 + max_sectors = min(max_sectors, BLK_DEF_MAX_SECTORS); 139 139 max_sectors = round_down(max_sectors, 140 140 limits->logical_block_size >> SECTOR_SHIFT); 141 141 limits->max_sectors = max_sectors;
+1 -2
drivers/block/null_blk/main.c
··· 2123 2123 blk_queue_physical_block_size(nullb->q, dev->blocksize); 2124 2124 if (!dev->max_sectors) 2125 2125 dev->max_sectors = queue_max_hw_sectors(nullb->q); 2126 - dev->max_sectors = min_t(unsigned int, dev->max_sectors, 2127 - BLK_DEF_MAX_SECTORS); 2126 + dev->max_sectors = min(dev->max_sectors, BLK_DEF_MAX_SECTORS); 2128 2127 blk_queue_max_hw_sectors(nullb->q, dev->max_sectors); 2129 2128 2130 2129 if (dev->virt_boundary)
+2 -1
include/linux/blkdev.h
··· 1095 1095 enum blk_default_limits { 1096 1096 BLK_MAX_SEGMENTS = 128, 1097 1097 BLK_SAFE_MAX_SECTORS = 255, 1098 - BLK_DEF_MAX_SECTORS = 2560, 1099 1098 BLK_MAX_SEGMENT_SIZE = 65536, 1100 1099 BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL, 1101 1100 }; 1101 + 1102 + #define BLK_DEF_MAX_SECTORS 2560u 1102 1103 1103 1104 static inline unsigned long queue_segment_boundary(const struct request_queue *q) 1104 1105 {