]> www.infradead.org Git - users/hch/block.git/commitdiff
reiserfs: use sb_bdev_nr_blocks
authorChristoph Hellwig <hch@lst.de>
Mon, 11 Oct 2021 14:58:24 +0000 (16:58 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 18 Oct 2021 04:57:16 +0000 (06:57 +0200)
Use the sb_bdev_nr_blocks helper instead of open coding it.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Jan Kara <jack@suse.cz>
fs/reiserfs/super.c

index 8647a00434ea4dc08ee82721ac41da25cbc783a9..076f9ab943060786306ab69d2016912b4b3f6129 100644 (file)
@@ -1199,9 +1199,7 @@ static int reiserfs_parse_options(struct super_block *s,
 
                        if (!strcmp(arg, "auto")) {
                                /* From JFS code, to auto-get the size. */
-                               *blocks =
-                                   i_size_read(s->s_bdev->bd_inode) >> s->
-                                   s_blocksize_bits;
+                               *blocks = sb_bdev_nr_blocks(s);
                        } else {
                                *blocks = simple_strtoul(arg, &p, 0);
                                if (*p != '\0') {