summaryrefslogtreecommitdiffstats
path: root/xlators/mount/fuse
diff options
context:
space:
mode:
authorAmar Tumballi <amar@gluster.com>2011-03-09 07:31:07 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-03-09 05:45:23 -0800
commit12254aebc39933baa8186b0fb1464bfa8eab6c3d (patch)
tree6bcaab98bbfbf2355830598b9a135696dbfd6ade /xlators/mount/fuse
parentce334f63c7e861bda0fabd0754a2b5c48157d001 (diff)
fuse: change the graph in 'GRAPH_NEW' event
Because in the current way, we have chances of changing the graph to old one too. Signed-off-by: Amar Tumballi <amar@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2503 () URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2503
Diffstat (limited to 'xlators/mount/fuse')
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index f4e142f0543..1cc9ab10a0d 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3320,11 +3320,25 @@ notify (xlator_t *this, int32_t event, void *data, ...)
private = this->private;
+ graph = data;
+
+ gf_log ("fuse", GF_LOG_DEBUG, "got event %d on graph %d",
+ event, ((graph) ? graph->id : 0));
+
switch (event)
{
case GF_EVENT_GRAPH_NEW:
- graph = data;
- /* TODO: */
+ /* We get only one GRAPH_NEW event per graph */
+ if (graph) {
+ ret = fuse_graph_setup (this, graph);
+ if (ret)
+ gf_log (this->name, GF_LOG_WARNING,
+ "failed to setup the graph");
+ if (!ret)
+ gf_log ("fuse", GF_LOG_INFO,
+ "got event GRAPH-NEW for graph %d",
+ ((graph) ? graph->id : 0));
+ }
break;
@@ -3332,14 +3346,6 @@ notify (xlator_t *this, int32_t event, void *data, ...)
case GF_EVENT_CHILD_DOWN:
case GF_EVENT_CHILD_CONNECTING:
{
- if (data) {
- graph = data;
- ret = fuse_graph_setup (this, graph);
- if (ret)
- gf_log (this->name, GF_LOG_WARNING,
- "failed to setup the graph");
- }
-
if (event == GF_EVENT_CHILD_UP) {
pthread_mutex_lock (&private->sync_mutex);