]> www.infradead.org Git - users/hch/block.git/commitdiff
affs: use bdev_nr_sectors instead of open coding it
authorChristoph Hellwig <hch@lst.de>
Mon, 11 Oct 2021 11:20:59 +0000 (13:20 +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/affs/super.c

index c6c2a513ec92d1549feff40c2f606bd1c0225154..c609005a9eaaa6d6c3b466f793218b723b37ad33 100644 (file)
@@ -389,7 +389,7 @@ static int affs_fill_super(struct super_block *sb, void *data, int silent)
         * blocks, we will have to change it.
         */
 
-       size = i_size_read(sb->s_bdev->bd_inode) >> 9;
+       size = bdev_nr_sectors(sb->s_bdev);
        pr_debug("initial blocksize=%d, #blocks=%d\n", 512, size);
 
        affs_set_blocksize(sb, PAGE_SIZE);