diff options
author | Amar Tumballi <amar@gluster.com> | 2011-03-10 00:07:43 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2011-03-09 21:59:52 -0800 |
commit | 5017098718059005e05873aa299a0fb5cb05fa90 (patch) | |
tree | e8516dce164fbb10c25ec52f640552307389f84a | |
parent | 93845ea7ccc44b79cf2a60526e4759059382f22b (diff) |
fuse: have the 'used' flag set in graph when used for first timev3.1.3qa7
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
-rw-r--r-- | libglusterfs/src/glusterfs.h | 2 | ||||
-rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 26 |
2 files changed, 16 insertions, 12 deletions
diff --git a/libglusterfs/src/glusterfs.h b/libglusterfs/src/glusterfs.h index 24ca5d186..c911a88c7 100644 --- a/libglusterfs/src/glusterfs.h +++ b/libglusterfs/src/glusterfs.h @@ -298,6 +298,8 @@ struct _glusterfs_graph { void *top; /* selected by -n */ int xl_count; int id; /* Used in logging */ + int used; /* Should be set when fuse gets + first CHILD_UP */ uint32_t volfile_checksum; }; typedef struct _glusterfs_graph glusterfs_graph_t; diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index 1cc9ab10a..b3141621b 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -3292,6 +3292,11 @@ fuse_graph_setup (xlator_t *this, glusterfs_graph_t *graph) if (priv->active_subvol == graph->top) return 0; /* This is a valid case */ + if (graph->used) + return 0; + + graph->used = 1; + itable = inode_table_new (0, graph->top); if (!itable) return -1; @@ -3307,6 +3312,9 @@ fuse_graph_setup (xlator_t *this, glusterfs_graph_t *graph) } pthread_mutex_unlock (&priv->sync_mutex); + gf_log ("fuse", GF_LOG_INFO, "switched graph to %d", + ((graph) ? graph->id : 0)); + return ret; } @@ -3328,26 +3336,20 @@ notify (xlator_t *this, int32_t event, void *data, ...) switch (event) { case GF_EVENT_GRAPH_NEW: - /* We get only one GRAPH_NEW event per graph */ + break; + + case GF_EVENT_CHILD_UP: + case GF_EVENT_CHILD_DOWN: + case GF_EVENT_CHILD_CONNECTING: + { 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; - - case GF_EVENT_CHILD_UP: - case GF_EVENT_CHILD_DOWN: - case GF_EVENT_CHILD_CONNECTING: - { if (event == GF_EVENT_CHILD_UP) { - pthread_mutex_lock (&private->sync_mutex); { private->child_up = 1; |