reiserfs: use sb_bdev_nr_blocks
authorChristoph Hellwig <hch@lst.de>
Mon, 18 Oct 2021 10:11:29 +0000 (12:11 +0200)
committerJens Axboe <axboe@kernel.dk>
Mon, 18 Oct 2021 20:43:23 +0000 (14:43 -0600)
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>
Link: https://lore.kernel.org/r/20211018101130.1838532-30-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
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') {