diff --git a/include/linux/genhd.h b/include/linux/genhd.h index cd4038fd57436c34bed8056fa071418b705c8fda..01d27f3a970e613d5482d7133b45a5098c5932c4 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -236,9 +236,14 @@ static inline sector_t get_start_sect(struct block_device *bdev) return bdev->bd_start_sect; } +static inline loff_t bdev_nr_bytes(struct block_device *bdev) +{ + return i_size_read(bdev->bd_inode); +} + static inline sector_t bdev_nr_sectors(struct block_device *bdev) { - return i_size_read(bdev->bd_inode) >> 9; + return bdev_nr_bytes(bdev) >> SECTOR_SHIFT; } static inline sector_t get_capacity(struct gendisk *disk)