diff options
| -rw-r--r-- | libglusterfs/src/defaults.c | 4 | ||||
| -rw-r--r-- | xlators/mount/fuse/src/fuse-bridge.c | 42 | 
2 files changed, 13 insertions, 33 deletions
diff --git a/libglusterfs/src/defaults.c b/libglusterfs/src/defaults.c index 00f84694a06..ec41ce92626 100644 --- a/libglusterfs/src/defaults.c +++ b/libglusterfs/src/defaults.c @@ -1219,10 +1219,11 @@ default_notify (xlator_t *this, int32_t event, void *data, ...)          break;          case GF_EVENT_CHILD_CONNECTING:          case GF_EVENT_CHILD_MODIFIED: +        case GF_EVENT_CHILD_DOWN:          case GF_EVENT_CHILD_UP:          {                  xlator_list_t *parent = this->parents; -                /* Handle the case of CHILD_UP specially, send it to fuse */ +                /* Handle case of CHILD_* event specially, send it to fuse */                  if (!parent && this->ctx && this->ctx->master)                          xlator_notify (this->ctx->master, event, this->graph, NULL); @@ -1234,7 +1235,6 @@ default_notify (xlator_t *this, int32_t event, void *data, ...)                  }          }          break; -        case GF_EVENT_CHILD_DOWN:          default:          {                  xlator_list_t *parent = this->parents; diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c index affa37d5b31..f988c0102ce 100644 --- a/xlators/mount/fuse/src/fuse-bridge.c +++ b/xlators/mount/fuse/src/fuse-bridge.c @@ -3324,21 +3324,10 @@ notify (xlator_t *this, int32_t event, void *data, ...)                  break; +        case GF_EVENT_CHILD_UP: +        case GF_EVENT_CHILD_DOWN:          case GF_EVENT_CHILD_CONNECTING:          { -                if (!private->fuse_thread_started) { -                        private->fuse_thread_started = 1; - -                        ret = pthread_create (&private->fuse_thread, NULL, -                                              fuse_thread_proc, this); -                        if (ret != 0) { -                                gf_log (this->name, GF_LOG_DEBUG, -                                        "pthread_create() failed (%s)", -                                        strerror (errno)); -                                break; -                        } -                } -                  if (data) {                          graph = data;                          ret = fuse_graph_setup (this, graph); @@ -3347,17 +3336,15 @@ notify (xlator_t *this, int32_t event, void *data, ...)                                          "failed to setup the graph");                  } -                break; -        } -        case GF_EVENT_CHILD_UP: -        { -                /* set priv->active_subvol */ -                /* set priv->first_lookup = 1 */ -                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); +                        { +                                private->child_up = 1; +                                pthread_cond_broadcast (&private->sync_cond); +                        } +                        pthread_mutex_unlock (&private->sync_mutex); +                }                  if (!private->fuse_thread_started) {                          private->fuse_thread_started = 1; @@ -3372,13 +3359,6 @@ notify (xlator_t *this, int32_t event, void *data, ...)                          }                  } -                pthread_mutex_lock (&private->sync_mutex); -                { -                        private->child_up = 1; -                        pthread_cond_broadcast (&private->sync_cond); -                } -                pthread_mutex_unlock (&private->sync_mutex); -                  break;          }  | 
