Jari Vetoniemi 10 лет назад
Родитель
Сommit
44fbdf5b65
1 измененных файлов: 4 добавлений и 6 удалений
  1. +4
    -6
      bin/server.c

+ 4
- 6
bin/server.c Просмотреть файл

@ -75,10 +75,8 @@ get_node(struct fs *fs, size_t node)
} }
static bool static bool
unlink_nodes(struct fs *fs, struct node *parent, struct node *child)
unlink_nodes(struct node *parent, struct node *child)
{ {
assert(fs);
if (!child) if (!child)
return false; return false;
@ -105,7 +103,7 @@ unlink_childs(struct fs *fs, struct node *parent)
size_t *c; size_t *c;
chck_iter_pool_for_each(&parent->childs, c) chck_iter_pool_for_each(&parent->childs, c)
unlink_nodes(fs, parent, get_node(fs, *c));
unlink_nodes(parent, get_node(fs, *c));
chck_iter_pool_release(&parent->childs); chck_iter_pool_release(&parent->childs);
} }
@ -118,7 +116,7 @@ link_nodes(struct fs *fs, struct node *parent, struct node *child)
if (!parent || !child) if (!parent || !child)
return false; return false;
if (child->parent != NONODE && !unlink_nodes(fs, get_node(fs, child->parent), child))
if (child->parent != NONODE && !unlink_nodes(get_node(fs, child->parent), child))
return false; return false;
if (child->stat.qid.path != NONODE && !chck_iter_pool_push_back(&parent->childs, &child->stat.qid.path)) if (child->stat.qid.path != NONODE && !chck_iter_pool_push_back(&parent->childs, &child->stat.qid.path))
@ -148,7 +146,7 @@ remove_node(struct fs *fs, struct node *node)
return; return;
unlink_childs(fs, node); unlink_childs(fs, node);
unlink_nodes(fs, get_node(fs, node->parent), node);
unlink_nodes(get_node(fs, node->parent), node);
node_release(node); node_release(node);
if (node->stat.qid.path != NONODE) { if (node->stat.qid.path != NONODE) {

Загрузка…
Отмена
Сохранить