]> www.infradead.org Git - users/hch/block.git/commitdiff
hfsplus: use bdev_nr_sectors instead of open coding it
authorChristoph Hellwig <hch@lst.de>
Mon, 11 Oct 2021 11:22:50 +0000 (13:22 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 12 Oct 2021 08:29:34 +0000 (10:29 +0200)
Use the proper helper to read the block device size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
fs/hfsplus/wrapper.c

index 0350dc7821bf951e367da0f0bee090f8fb6a50ce..51ae6f1eb4a55bff5430944870d90eca7aaca70a 100644 (file)
@@ -131,7 +131,7 @@ static int hfsplus_get_last_session(struct super_block *sb,
 
        /* default values */
        *start = 0;
-       *size = i_size_read(sb->s_bdev->bd_inode) >> 9;
+       *size = bdev_nr_sectors(sb->s_bdev);
 
        if (HFSPLUS_SB(sb)->session >= 0) {
                struct cdrom_tocentry te;