mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
block: add a loff_t cast to bdev_nr_bytes
Not really needed as both loff_t and sector_t are always 64-bits wide, but this documents the different types a bit better. Signed-off-by: Christoph Hellwig <hch@lst.de> Link: https://lore.kernel.org/r/20211104172037.531803-1-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
committed by
Jens Axboe
parent
97eeb5fc14
commit
2116274af4
@@ -243,7 +243,7 @@ static inline sector_t bdev_nr_sectors(struct block_device *bdev)
|
||||
|
||||
static inline loff_t bdev_nr_bytes(struct block_device *bdev)
|
||||
{
|
||||
return bdev_nr_sectors(bdev) << SECTOR_SHIFT;
|
||||
return (loff_t)bdev_nr_sectors(bdev) << SECTOR_SHIFT;
|
||||
}
|
||||
|
||||
static inline sector_t get_capacity(struct gendisk *disk)
|
||||
|
||||
Reference in New Issue
Block a user