diff options
| author | Basavanagowda Kanur <gowda@gluster.com> | 2009-06-22 07:53:03 +0000 | 
|---|---|---|
| committer | Anand V. Avati <avati@dev.gluster.com> | 2009-06-22 12:29:13 -0700 | 
| commit | 384ee312ba44e3d8c456ab0c93d74274597d71f4 (patch) | |
| tree | a9ff3ed9bacf6eb0bdee874ddf48cc41c6615079 | |
| parent | 6010e2a4e14a850469f0977e43245e64a33301fa (diff) | |
glusterfsd - build proper mount/fuse structure.
while appending mount/fuse to a translator tree, make sure
that <xlator_t-of-fuse>->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 <xlator_t>->children
Signed-off-by: Anand V. Avati <avati@dev.gluster.com>
| -rw-r--r-- | glusterfsd/src/glusterfsd.c | 19 | 
1 files changed, 17 insertions, 2 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index ae887e9ce84..4ee7689bf6a 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -206,7 +206,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) @@ -237,7 +252,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,  | 
