summaryrefslogtreecommitdiff
path: root/include/linux/genhd.h
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-11-04 18:20:37 +0100
committerJens Axboe <axboe@kernel.dk>2021-11-04 11:28:03 -0600
commit2116274af46b12df7cea1dc5698f3cf2f231f8a9 (patch)
treed2b8e09c068cadc5e082705259548b92216d95db /include/linux/genhd.h
parent97eeb5fc14cc4b2091df8b841a07a1ac69f2d762 (diff)
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>
Diffstat (limited to 'include/linux/genhd.h')
-rw-r--r--include/linux/genhd.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 900325aa5d31..1dce769c4596 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -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)