Skip to content

Commit 2116274

Browse files
Christoph Hellwigaxboe
authored andcommitted
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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jens Axboe <[email protected]>
1 parent 97eeb5f commit 2116274

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/linux/genhd.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ static inline sector_t bdev_nr_sectors(struct block_device *bdev)
243243

244244
static inline loff_t bdev_nr_bytes(struct block_device *bdev)
245245
{
246-
return bdev_nr_sectors(bdev) << SECTOR_SHIFT;
246+
return (loff_t)bdev_nr_sectors(bdev) << SECTOR_SHIFT;
247247
}
248248

249249
static inline sector_t get_capacity(struct gendisk *disk)

0 commit comments

Comments
 (0)