summaryrefslogtreecommitdiff
path: root/fs/udf/lowlevel.c
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2021-10-18 13:11:30 +0300
committerJens Axboe <axboe@kernel.dk>2021-10-18 23:43:23 +0300
commite4ae4735f7c2da77db57ee090b9f513bfe80d285 (patch)
treea3faeed79221ea5cf51034edd827641aaebbbcc3 /fs/udf/lowlevel.c
parent2ffae493dc15ee2225bd68254e1cdb1449b81ec7 (diff)
downloadlinux-e4ae4735f7c2da77db57ee090b9f513bfe80d285.tar.xz
udf: use sb_bdev_nr_blocks
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-31-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/udf/lowlevel.c')
-rw-r--r--fs/udf/lowlevel.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/udf/lowlevel.c b/fs/udf/lowlevel.c
index f1094cdcd6cd..46d697172197 100644
--- a/fs/udf/lowlevel.c
+++ b/fs/udf/lowlevel.c
@@ -47,8 +47,7 @@ unsigned int udf_get_last_session(struct super_block *sb)
unsigned long udf_get_last_block(struct super_block *sb)
{
- struct block_device *bdev = sb->s_bdev;
- struct cdrom_device_info *cdi = disk_to_cdi(bdev->bd_disk);
+ struct cdrom_device_info *cdi = disk_to_cdi(sb->s_bdev->bd_disk);
unsigned long lblock = 0;
/*
@@ -56,7 +55,7 @@ unsigned long udf_get_last_block(struct super_block *sb)
* Try using the device size...
*/
if (!cdi || cdrom_get_last_written(cdi, &lblock) || lblock == 0)
- lblock = i_size_read(bdev->bd_inode) >> sb->s_blocksize_bits;
+ lblock = sb_bdev_nr_blocks(sb);
if (lblock)
return lblock - 1;