From 9db873364de85e6b5f972dbd2bada80591ef8af4 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Mon, 23 Dec 2019 00:42:53 +0100 Subject: Bring back the flat list of inodes in libfstree It makes further processing simpler and doesn't leak the abstraction into upper layers. Signed-off-by: David Oberhollenzer --- include/fstree.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'include') diff --git a/include/fstree.h b/include/fstree.h index 7f81cf5..6628540 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -91,6 +91,9 @@ struct fstree_t { struct stat defaults; size_t unique_inode_count; + /* flat array of all nodes that have an inode number */ + tree_node_t **inodes; + tree_node_t *root; /* linear linked list of all regular files */ @@ -169,6 +172,9 @@ int fstree_from_file(fstree_t *fs, const char *filename, FILE *fp); The total inode count is stored in unique_inode_count. The head of the file list is pointed to by fs->files. + The "inodes" array is allocated and each node that has an inode number is + mapped into the array at index inode_num - 1. + Returns 0 on success, prints to stderr on failure. */ int fstree_post_process(fstree_t *fs); -- cgit v1.2.3