diff options
-rw-r--r-- | glusterfsd/src/glusterfsd.c | 27 | ||||
-rw-r--r-- | libglusterfs/src/xlator.h | 2 |
2 files changed, 28 insertions, 1 deletions
diff --git a/glusterfsd/src/glusterfsd.c b/glusterfsd/src/glusterfsd.c index d3f1be02867..14627f0af94 100644 --- a/glusterfsd/src/glusterfsd.c +++ b/glusterfsd/src/glusterfsd.c @@ -607,6 +607,31 @@ _xlator_graph_init (xlator_t *xl) } int +glusterfs_graph_parent_up (xlator_t *graph) +{ + xlator_t *trav = NULL; + int ret = -1; + + trav = graph; + + while (trav->prev) + trav = trav->prev; + + while (trav) { + if (!xlator_has_parent (trav)) { + ret = trav->notify (trav, GF_EVENT_PARENT_UP, trav); + } + + if (ret) + break; + + trav = trav->next; + } + + return ret; +} + +int glusterfs_graph_init (xlator_t *graph, int fuse) { volume_opt_list_t *vol_opt = NULL; @@ -1366,7 +1391,7 @@ main (int argc, char *argv[]) } /* Send PARENT_UP notify to all the translators now */ - graph->notify (graph, GF_EVENT_PARENT_UP, ctx->graph); + glusterfs_graph_parent_up (graph); gf_log ("glusterfs", GF_LOG_NORMAL, "Successfully started"); diff --git a/libglusterfs/src/xlator.h b/libglusterfs/src/xlator.h index d0c8ae83643..b8222911a59 100644 --- a/libglusterfs/src/xlator.h +++ b/libglusterfs/src/xlator.h @@ -926,6 +926,8 @@ struct _xlator { void *private; }; +#define xlator_has_parent(xl) (xl->parents != NULL) + int validate_xlator_volume_options (xlator_t *xl, volume_option_t *opt); int32_t xlator_set_type (xlator_t *xl, const char *type); |