X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=blobdiff_plain;f=buffer_tree.c;h=bb854124c6be6089f604815473755af783ceb5e8;hp=63be36d7a10042c5f21b6a95677cdea369ffa12c;hb=a55083779b7029a251019b8ef4d053d6eb29220a;hpb=00583bed658c70aacf2a94532904fd403c5ee7f1 diff --git a/buffer_tree.c b/buffer_tree.c index 63be36d7..bb854124 100644 --- a/buffer_tree.c +++ b/buffer_tree.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2009-2012 Andre Noll + * Copyright (C) 2009-2013 Andre Noll * * Licensed under the GPL v2. For licencing details see COPYING. */ @@ -295,9 +295,10 @@ struct btr_node *btr_new_node(struct btr_node_description *bnd) bnd->child->parent = btrn; goto out; } - PARA_EMERG_LOG("inserting internal nodes not yet supported.\n"); - exit(EXIT_FAILURE); - assert(bnd->child->parent == bnd->parent); + list_add_tail(&btrn->node, &bnd->parent->children); + list_move(&bnd->child->node, &btrn->children); + bnd->child->parent = btrn; + PARA_INFO_LOG("added %s as internal node\n", bnd->name); out: return btrn; } @@ -1225,3 +1226,8 @@ void btr_get_node_start(struct btr_node *btrn, struct timeval *tv) { *tv = btrn->start; } + +struct btr_node *btr_parent(struct btr_node *btrn) +{ + return btrn->parent; +}