summaryrefslogtreecommitdiff
path: root/fs/erofs
diff options
context:
space:
mode:
authorFerry Meng <mengferry@linux.alibaba.com>2023-10-26 05:16:26 +0300
committerGao Xiang <hsiangkao@linux.alibaba.com>2023-10-31 01:58:35 +0300
commit6b8a113cae6cc517579a33ad484355c3e4b3d8e7 (patch)
treed128180453b98f052afcbe5022d984bd5d2329ca /fs/erofs
parentefb4fb02cef3ab410b603c8f0e1c67f61d55f542 (diff)
downloadlinux-6b8a113cae6cc517579a33ad484355c3e4b3d8e7.tar.xz
erofs: get rid of ROOT_NID()
Let's open code this helper for simplicity. Signed-off-by: Ferry Meng <mengferry@linux.alibaba.com> Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com> Reviewed-by: Yue Hu <huyue2@coolpad.com> Reviewed-by: Chao Yu <chao@kernel.org> Link: https://lore.kernel.org/r/20231026021627.23284-1-mengferry@linux.alibaba.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/erofs')
-rw-r--r--fs/erofs/internal.h2
-rw-r--r--fs/erofs/super.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/fs/erofs/internal.h b/fs/erofs/internal.h
index d8de61350dc0..9586674ba55c 100644
--- a/fs/erofs/internal.h
+++ b/fs/erofs/internal.h
@@ -228,8 +228,6 @@ struct erofs_buf {
};
#define __EROFS_BUF_INITIALIZER ((struct erofs_buf){ .page = NULL })
-#define ROOT_NID(sb) ((sb)->root_nid)
-
#define erofs_blknr(sb, addr) ((addr) >> (sb)->s_blocksize_bits)
#define erofs_blkoff(sb, addr) ((addr) & ((sb)->s_blocksize - 1))
#define erofs_pos(sb, blk) ((erofs_off_t)(blk) << (sb)->s_blocksize_bits)
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index cc44fb2e001e..b1518df3af00 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -668,13 +668,13 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
xa_init(&sbi->managed_pslots);
#endif
- inode = erofs_iget(sb, ROOT_NID(sbi));
+ inode = erofs_iget(sb, sbi->root_nid);
if (IS_ERR(inode))
return PTR_ERR(inode);
if (!S_ISDIR(inode->i_mode)) {
erofs_err(sb, "rootino(nid %llu) is not a directory(i_mode %o)",
- ROOT_NID(sbi), inode->i_mode);
+ sbi->root_nid, inode->i_mode);
iput(inode);
return -EINVAL;
}
@@ -704,7 +704,7 @@ static int erofs_fc_fill_super(struct super_block *sb, struct fs_context *fc)
if (err)
return err;
- erofs_info(sb, "mounted with root inode @ nid %llu.", ROOT_NID(sbi));
+ erofs_info(sb, "mounted with root inode @ nid %llu.", sbi->root_nid);
return 0;
}