Thread (63 messages) 63 messages, 11 authors, 2021-10-18
STALE1687d

[PATCH 13/30] cramfs: use bdev_nr_bytes instead of open coding it

From: Christoph Hellwig <hch@lst.de>
Date: 2021-10-15 13:28:53
Also in: dm-devel, linux-bcache, linux-block, linux-btrfs, linux-fsdevel, linux-nfs, linux-nvme, linux-raid, linux-scsi, ntfs3, target-devel
Subsystem: cramfs filesystem, filesystems (vfs and infrastructure), the rest · Maintainers: Nicolas Pitre, Alexander Viro, Christian Brauner, Linus Torvalds

Use the proper helper to read the block device size.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/cramfs/inode.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/cramfs/inode.c b/fs/cramfs/inode.c
index 2be65269a987c..666aa380011e0 100644
--- a/fs/cramfs/inode.c
+++ b/fs/cramfs/inode.c
@@ -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++) {
-- 
2.30.2
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help