]> www.infradead.org Git - users/hch/block.git/commitdiff
reiserfs: use bdev_nr_sectors instead of open coding it
authorChristoph Hellwig <hch@lst.de>
Mon, 11 Oct 2021 14:57:23 +0000 (16:57 +0200)
committerChristoph Hellwig <hch@lst.de>
Tue, 12 Oct 2021 08:29:35 +0000 (10:29 +0200)
Use the proper helper to read the block device size and remove two
cargo culted checks that can't be false.

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

index 58481f8d63d5b2c26850c23a437902d43d4fb09d..6c9681e2809f0a817715ec0f7e2eb26cf05e8ba7 100644 (file)
@@ -1986,8 +1986,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
         * smaller than the filesystem. If the check fails then abort and
         * scream, because bad stuff will happen otherwise.
         */
-       if (s->s_bdev && s->s_bdev->bd_inode
-           && i_size_read(s->s_bdev->bd_inode) <
+       if ((bdev_nr_sectors(s->s_bdev) << SECTOR_SHIFT) <
            sb_block_count(rs) * sb_blocksize(rs)) {
                SWARN(silent, s, "", "Filesystem cannot be "
                      "mounted because it is bigger than the device");