diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 01d27f3a970e..7b0326661a1e 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h @@ -251,6 +251,12 @@ static inline sector_t get_capacity(struct gendisk *disk) return bdev_nr_sectors(disk->part0); } +static inline u64 sb_bdev_nr_blocks(struct super_block *sb) +{ + return bdev_nr_sectors(sb->s_bdev) >> + (sb->s_blocksize_bits - SECTOR_SHIFT); +} + int bdev_disk_changed(struct gendisk *disk, bool invalidate); void blk_drop_partitions(struct gendisk *disk);