summaryrefslogtreecommitdiff
path: root/unpack/read_fstree.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-04 22:48:36 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-05-04 22:48:36 +0200
commit363de21c65fab165851fae1f8ef9665edb1ff508 (patch)
tree4b2a6df36c6b2944708f440e10b37253b00c2868 /unpack/read_fstree.c
parentabb31e7327e50cf2874ae9095eb147ed753862a3 (diff)
cleanup: rdsquashfs: store global data in structure
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'unpack/read_fstree.c')
-rw-r--r--unpack/read_fstree.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/unpack/read_fstree.c b/unpack/read_fstree.c
index 0b75d8b..544af83 100644
--- a/unpack/read_fstree.c
+++ b/unpack/read_fstree.c
@@ -114,8 +114,7 @@ static int fill_dir(meta_reader_t *ir, meta_reader_t *dr, tree_node_t *root,
return 0;
}
-int read_fstree(fstree_t *out, int fd, sqfs_super_t *super, compressor_t *cmp,
- int flags)
+int read_fstree(fstree_t *out, sqfs_super_t *super, unsqfs_info_t *info)
{
sqfs_inode_generic_t *root;
meta_reader_t *ir, *dr;
@@ -124,18 +123,18 @@ int read_fstree(fstree_t *out, int fd, sqfs_super_t *super, compressor_t *cmp,
int status = -1;
size_t offset;
- ir = meta_reader_create(fd, cmp);
+ ir = meta_reader_create(info->sqfsfd, info->cmp);
if (ir == NULL)
return -1;
- dr = meta_reader_create(fd, cmp);
+ dr = meta_reader_create(info->sqfsfd, info->cmp);
if (dr == NULL)
goto out_ir;
if (id_table_init(&idtbl))
goto out_dr;
- if (id_table_read(&idtbl, fd, super, cmp))
+ if (id_table_read(&idtbl, info->sqfsfd, super, info->cmp))
goto out_id;
block_start = super->root_inode_ref >> 16;
@@ -166,7 +165,7 @@ int read_fstree(fstree_t *out, int fd, sqfs_super_t *super, compressor_t *cmp,
if (out->root == NULL)
goto out_id;
- if (fill_dir(ir, dr, out->root, super, &idtbl, flags))
+ if (fill_dir(ir, dr, out->root, super, &idtbl, info->flags))
goto fail_fs;
fstree_sort(out);