[PATCH 11/21] erofs: use dsb instead of layout for ondisk super_block
Gao Xiang
hsiangkao at aol.com
Sun Sep 1 15:51:20 AEST 2019
From: Gao Xiang <gaoxiang25 at huawei.com>
As Christoph pointed out [1], "Why is the variable name
for the on-disk subperblock layout? We usually still
calls this something with sb in the name, e.g. dsb.
for disksuper block. " Let's fix it.
[1] https://lore.kernel.org/r/20190829101545.GC20598@infradead.org/
Signed-off-by: Gao Xiang <gaoxiang25 at huawei.com>
---
fs/erofs/super.c | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 8c43af5d5e57..c1a42ea7b72f 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -47,9 +47,9 @@ static void free_inode(struct inode *inode)
}
static bool check_layout_compatibility(struct super_block *sb,
- struct erofs_super_block *layout)
+ struct erofs_super_block *dsb)
{
- const unsigned int requirements = le32_to_cpu(layout->requirements);
+ const unsigned int requirements = le32_to_cpu(dsb->requirements);
EROFS_SB(sb)->requirements = requirements;
@@ -66,7 +66,7 @@ static int superblock_read(struct super_block *sb)
{
struct erofs_sb_info *sbi;
struct buffer_head *bh;
- struct erofs_super_block *layout;
+ struct erofs_super_block *dsb;
unsigned int blkszbits;
int ret;
@@ -78,16 +78,16 @@ static int superblock_read(struct super_block *sb)
}
sbi = EROFS_SB(sb);
- layout = (struct erofs_super_block *)((u8 *)bh->b_data
- + EROFS_SUPER_OFFSET);
+ dsb = (struct erofs_super_block *)((u8 *)bh->b_data +
+ EROFS_SUPER_OFFSET);
ret = -EINVAL;
- if (le32_to_cpu(layout->magic) != EROFS_SUPER_MAGIC_V1) {
+ if (le32_to_cpu(dsb->magic) != EROFS_SUPER_MAGIC_V1) {
errln("cannot find valid erofs superblock");
goto out;
}
- blkszbits = layout->blkszbits;
+ blkszbits = dsb->blkszbits;
/* 9(512 bytes) + LOG_SECTORS_PER_BLOCK == LOG_BLOCK_SIZE */
if (blkszbits != LOG_BLOCK_SIZE) {
errln("blksize %u isn't supported on this platform",
@@ -95,25 +95,25 @@ static int superblock_read(struct super_block *sb)
goto out;
}
- if (!check_layout_compatibility(sb, layout))
+ if (!check_layout_compatibility(sb, dsb))
goto out;
- sbi->blocks = le32_to_cpu(layout->blocks);
- sbi->meta_blkaddr = le32_to_cpu(layout->meta_blkaddr);
+ sbi->blocks = le32_to_cpu(dsb->blocks);
+ sbi->meta_blkaddr = le32_to_cpu(dsb->meta_blkaddr);
#ifdef CONFIG_EROFS_FS_XATTR
- sbi->xattr_blkaddr = le32_to_cpu(layout->xattr_blkaddr);
+ sbi->xattr_blkaddr = le32_to_cpu(dsb->xattr_blkaddr);
#endif
sbi->islotbits = ffs(sizeof(struct erofs_inode_v1)) - 1;
- sbi->root_nid = le16_to_cpu(layout->root_nid);
- sbi->inos = le64_to_cpu(layout->inos);
+ sbi->root_nid = le16_to_cpu(dsb->root_nid);
+ sbi->inos = le64_to_cpu(dsb->inos);
- sbi->build_time = le64_to_cpu(layout->build_time);
- sbi->build_time_nsec = le32_to_cpu(layout->build_time_nsec);
+ sbi->build_time = le64_to_cpu(dsb->build_time);
+ sbi->build_time_nsec = le32_to_cpu(dsb->build_time_nsec);
- memcpy(&sb->s_uuid, layout->uuid, sizeof(layout->uuid));
+ memcpy(&sb->s_uuid, dsb->uuid, sizeof(dsb->uuid));
- ret = strscpy(sbi->volume_name, layout->volume_name,
- sizeof(layout->volume_name));
+ ret = strscpy(sbi->volume_name, dsb->volume_name,
+ sizeof(dsb->volume_name));
if (ret < 0) { /* -E2BIG */
errln("bad volume name without NIL terminator");
ret = -EFSCORRUPTED;
--
2.17.1
More information about the Linux-erofs
mailing list