From 22fba34bcd0f2944def234fa684d1c9cc4d65310 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Tue, 23 Jul 2019 16:12:40 +0200 Subject: Generate linear file list in fstree Instead of doing DFS on the fly in gensquashfs, churn out a linked list of all files in an archive. Future improvements in packing strategies can go into this file. This can also be usefull for other purposes in the future, such as file deduplication or as a work queue for the unpacker. Signed-off-by: David Oberhollenzer --- include/fstree.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'include/fstree.h') diff --git a/include/fstree.h b/include/fstree.h index 2ba2b80..eb7b65f 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -57,6 +57,9 @@ struct tree_xattr_t { /* Additional meta data stored in a tree_node_t for regular files. */ struct file_info_t { + /* Linked list pointer for files in fstree_t */ + file_info_t *next; + /* Path to the input file. */ char *input_file; @@ -157,6 +160,9 @@ struct fstree_t { /* linear array of tree nodes. inode number is array index */ tree_node_t **inode_table; + + /* linear linked list of all regular files */ + file_info_t *files; }; /* @@ -252,6 +258,8 @@ int fstree_relabel_selinux(fstree_t *fs, const char *filename); /* Returns 0 on success. Prints to stderr on failure */ int fstree_gen_inode_table(fstree_t *fs); +void fstree_gen_file_list(fstree_t *fs); + /* Generate a string holding the full path of a node. Returned string must be freed. -- cgit v1.2.3