mirror of
https://github.com/edk2-porting/linux-next.git
synced 2024-12-12 23:33:55 +08:00
cramfs: use bdev_nr_bytes instead of open coding it
Use the proper helper to read the block device size. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20211018101130.1838532-14-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
This commit is contained in:
parent
cda00eba02
commit
5816e91e4a
@ -209,7 +209,7 @@ static void *cramfs_blkdev_read(struct super_block *sb, unsigned int offset,
|
||||
return read_buffers[i] + blk_offset;
|
||||
}
|
||||
|
||||
devsize = mapping->host->i_size >> PAGE_SHIFT;
|
||||
devsize = bdev_nr_bytes(sb->s_bdev) >> PAGE_SHIFT;
|
||||
|
||||
/* Ok, read in BLKS_PER_BUF pages completely first. */
|
||||
for (i = 0; i < BLKS_PER_BUF; i++) {
|
||||
|
Loading…
Reference in New Issue
Block a user