summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-23 16:12:40 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-07-25 22:10:24 +0200
commit22fba34bcd0f2944def234fa684d1c9cc4d65310 (patch)
treebb7d122e7d2bd06583b358f0530dc7ee189ef279 /include
parent8cc66cf51bdbf50e3476b58106627afc7adc1300 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/fstree.h8
1 files changed, 8 insertions, 0 deletions
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.