From c699050f7634e782c776242eb95e5754fce29e55 Mon Sep 17 00:00:00 2001 From: Basavanagowda Kanur Date: Mon, 22 Jun 2009 07:53:03 +0000 Subject: glusterfsd - build proper mount/fuse structure. while appending mount/fuse to a translator tree, make sure that ->next points to the first xlator in the list of xlators and not the subvolume of mount/fuse. NOTE: tree traversal should always happen through ->children Signed-off-by: Anand V. Avati --- glusterfsd/src/glusterfsd.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index af931a939..f0054189b 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -194,7 +194,22 @@ _gf_dump_details (int argc, char **argv) fflush (gf_log_logfile); } - +static xlator_t * +gf_get_first_xlator (xlator_t *list) +{ + xlator_t *trav = NULL, *head = NULL; + + trav = list; + do { + if (trav->prev == NULL) { + head = trav; + } + + trav = trav->prev; + } while (trav != NULL); + + return head; +} static xlator_t * _add_fuse_mount (xlator_t *graph) @@ -225,7 +240,7 @@ _add_fuse_mount (xlator_t *graph) } top->children = xlchild; top->ctx = graph->ctx; - top->next = graph; + top->next = gf_get_first_xlator (graph); top->options = get_new_dict (); ret = dict_set_static_ptr (top->options, ZR_MOUNTPOINT_OPT, -- cgit