summaryrefslogtreecommitdiff
path: root/fs/erofs/super.c
diff options
context:
space:
mode:
authorGao Xiang <hsiangkao@linux.alibaba.com>2023-04-07 17:17:04 +0300
committerGao Xiang <hsiangkao@linux.alibaba.com>2023-04-16 20:15:50 +0300
commiteb2c5e41be1495cf7a20ff49df473b1c45b82e77 (patch)
tree939ee6fc72404440e86150d19e797acbcc1e7d3b /fs/erofs/super.c
parentcb9bce79514392a9a216ff67148e05e2d72c28bd (diff)
downloadlinux-eb2c5e41be1495cf7a20ff49df473b1c45b82e77.tar.xz
erofs: keep meta inode into erofs_buf
So that erofs_read_metadata() can read metadata from other inodes (e.g. packed inode) as well. Signed-off-by: Jingbo Xu <jefflexu@linux.alibaba.com> Acked-by: Chao Yu <chao@kernel.org> Link: https://lore.kernel.org/r/20230407141710.113882-2-jefflexu@linux.alibaba.com Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Diffstat (limited to 'fs/erofs/super.c')
-rw-r--r--fs/erofs/super.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 5475ff2f7327..f45a15ee2311 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -135,7 +135,7 @@ static void *erofs_read_metadata(struct super_block *sb, struct erofs_buf *buf,
int len, i, cnt;
*offset = round_up(*offset, 4);
- ptr = erofs_read_metabuf(buf, sb, erofs_blknr(sb, *offset), EROFS_KMAP);
+ ptr = erofs_bread(buf, erofs_blknr(sb, *offset), EROFS_KMAP);
if (IS_ERR(ptr))
return ptr;
@@ -151,8 +151,7 @@ static void *erofs_read_metadata(struct super_block *sb, struct erofs_buf *buf,
for (i = 0; i < len; i += cnt) {
cnt = min_t(int, sb->s_blocksize - erofs_blkoff(sb, *offset),
len - i);
- ptr = erofs_read_metabuf(buf, sb, erofs_blknr(sb, *offset),
- EROFS_KMAP);
+ ptr = erofs_bread(buf, erofs_blknr(sb, *offset), EROFS_KMAP);
if (IS_ERR(ptr)) {
kfree(buffer);
return ptr;
@@ -179,6 +178,7 @@ static int erofs_load_compr_cfgs(struct super_block *sb,
return -EINVAL;
}
+ erofs_init_metabuf(&buf, sb);
offset = EROFS_SUPER_OFFSET + sbi->sb_size;
alg = 0;
for (algs = sbi->available_compr_algs; algs; algs >>= 1, ++alg) {