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

block: Ensure physical block size is unsigned int

Physical block size was declared unsigned int to accomodate the maximum
size reported by READ CAPACITY(16). Make sure we use the right type in
the related functions.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Acked-by: Mike Snitzer <snitzer@redhat.com>
Cc: stable@kernel.org
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>

authored by

Martin K. Petersen and committed by
Jens Axboe
892b6f90 c49c06e4

+3 -3
+1 -1
block/blk-settings.c
··· 344 344 * hardware can operate on without reverting to read-modify-write 345 345 * operations. 346 346 */ 347 - void blk_queue_physical_block_size(struct request_queue *q, unsigned short size) 347 + void blk_queue_physical_block_size(struct request_queue *q, unsigned int size) 348 348 { 349 349 q->limits.physical_block_size = size; 350 350
+2 -2
include/linux/blkdev.h
··· 860 860 extern void blk_queue_max_discard_sectors(struct request_queue *q, 861 861 unsigned int max_discard_sectors); 862 862 extern void blk_queue_logical_block_size(struct request_queue *, unsigned short); 863 - extern void blk_queue_physical_block_size(struct request_queue *, unsigned short); 863 + extern void blk_queue_physical_block_size(struct request_queue *, unsigned int); 864 864 extern void blk_queue_alignment_offset(struct request_queue *q, 865 865 unsigned int alignment); 866 866 extern void blk_limits_io_min(struct queue_limits *limits, unsigned int min); ··· 1013 1013 return q->limits.physical_block_size; 1014 1014 } 1015 1015 1016 - static inline int bdev_physical_block_size(struct block_device *bdev) 1016 + static inline unsigned int bdev_physical_block_size(struct block_device *bdev) 1017 1017 { 1018 1018 return queue_physical_block_size(bdev_get_queue(bdev)); 1019 1019 }