diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-04-19 08:51:26 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2023-04-19 11:17:51 +0200 |
commit | 75fb524b5702bca4f8467309f7d95f9937ec6683 (patch) | |
tree | b47a037c0f24873a9fc5b3f5b08583c9ad90de08 /lib/fstree/src/post_process.c | |
parent | a13df03fddd9499960d4653aaee0970983b65f73 (diff) |
libfstree: get rid of dir_info_t
The single boolean created_implicitly can be replaced with a general
purpose flag field. The "children" pointer can then be hoisted directly
into the data union of tree_node_t.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree/src/post_process.c')
-rw-r--r-- | lib/fstree/src/post_process.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/fstree/src/post_process.c b/lib/fstree/src/post_process.c index f614906..5bf7e7d 100644 --- a/lib/fstree/src/post_process.c +++ b/lib/fstree/src/post_process.c @@ -18,7 +18,7 @@ static int alloc_inode_num_dfs(fstree_t *fs, tree_node_t *root) tree_node_t *it; size_t inum; - for (it = root->data.dir.children; it != NULL; it = it->next) { + for (it = root->data.children; it != NULL; it = it->next) { if (S_ISDIR(it->mode)) { has_subdirs = true; break; @@ -26,7 +26,7 @@ static int alloc_inode_num_dfs(fstree_t *fs, tree_node_t *root) } if (has_subdirs) { - for (it = root->data.dir.children; it != NULL; it = it->next) { + for (it = root->data.children; it != NULL; it = it->next) { if (S_ISDIR(it->mode)) { if (alloc_inode_num_dfs(fs, it)) return -1; @@ -34,7 +34,7 @@ static int alloc_inode_num_dfs(fstree_t *fs, tree_node_t *root) } } - for (it = root->data.dir.children; it != NULL; it = it->next) { + for (it = root->data.children; it != NULL; it = it->next) { if (it->mode != FSTREE_MODE_HARD_LINK_RESOLVED) { if (SZ_ADD_OV(fs->unique_inode_count, 1, &inum)) goto fail_ov; @@ -65,7 +65,7 @@ static file_info_t *file_list_dfs(tree_node_t *n) if (S_ISDIR(n->mode)) { file_info_t *list = NULL, *last = NULL; - for (n = n->data.dir.children; n != NULL; n = n->next) { + for (n = n->data.children; n != NULL; n = n->next) { if (list == NULL) { list = file_list_dfs(n); if (list == NULL) @@ -93,7 +93,7 @@ static void map_inodes_dfs(fstree_t *fs, tree_node_t *n) fs->inodes[n->inode_num - 1] = n; if (S_ISDIR(n->mode)) { - for (n = n->data.dir.children; n != NULL; n = n->next) + for (n = n->data.children; n != NULL; n = n->next) map_inodes_dfs(fs, n); } } @@ -107,7 +107,7 @@ static void reorder_hard_links(fstree_t *fs) if (!S_ISDIR(fs->inodes[i]->mode)) continue; - it = fs->inodes[i]->data.dir.children; + it = fs->inodes[i]->data.children; for (; it != NULL; it = it->next) { if (it->mode != FSTREE_MODE_HARD_LINK_RESOLVED) |