summaryrefslogtreecommitdiff
path: root/lib/fstree/node_stat.c
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-19 13:21:52 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2019-06-19 15:17:52 +0200
commit19fbebec161c749e5bfe440e4514e2bc2d2ac3d4 (patch)
treeaac5d9442ec0979cd52e33332db29b8cd9edcf07 /lib/fstree/node_stat.c
parent9864ea5b2045f4bd72633152d71dd1c7f8b0b7f9 (diff)
Cleanup fstree code
Replace default_$FIELD with a struct stat. Merge the rest of add_node/add_file into mknode and add by path+stat. Expose the mknode function and replace all the duplicated node pointer arithmetic magic with a call to mknode. Plus a generic cleanup by utlizing new util functions. Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree/node_stat.c')
-rw-r--r--lib/fstree/node_stat.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/fstree/node_stat.c b/lib/fstree/node_stat.c
index a6ec097..8f62a0f 100644
--- a/lib/fstree/node_stat.c
+++ b/lib/fstree/node_stat.c
@@ -7,17 +7,12 @@ void fstree_node_stat(fstree_t *fs, tree_node_t *node, struct stat *sb)
{
tree_node_t *n;
- memset(sb, 0, sizeof(*sb));
-
+ *sb = fs->defaults;
sb->st_ino = node->inode_num;
sb->st_mode = node->mode;
sb->st_nlink = 1;
sb->st_uid = node->uid;
sb->st_gid = node->gid;
- sb->st_blksize = fs->block_size;
- sb->st_mtime = fs->default_mtime;
- sb->st_atime = sb->st_mtime;
- sb->st_ctime = sb->st_mtime;
switch (node->mode & S_IFMT) {
case S_IFDIR: