summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-23 00:42:53 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-12-23 00:50:00 +0100
commit9db873364de85e6b5f972dbd2bada80591ef8af4 (patch)
tree32be9fbb328e6f5f3c1ef4111fe1dec7a19827df /include
parentb16616ef092e8cd97674aac3380c5d7c600d7c61 (diff)
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 <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include')
-rw-r--r--include/fstree.h6
1 files changed, 6 insertions, 0 deletions
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);