summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaghavendra G <raghavendra@gluster.com>2012-03-05 15:15:04 +0530
committerVijay Bellur <vijay@gluster.com>2012-03-14 03:57:32 -0700
commit1e5653165a97999288cbf40e670d6c84a31ad3f6 (patch)
treea6c5c2dcd96d9e9cb68d34563d49beefd793c28d
parenta059bc30561a3046e255ba1e6ad54b09f0b03636 (diff)
fuse-bridge/graph-cleanup: don't provide a cbk for cleanup syncop task
without a cbk, syntask_new returns only after the task is complete. Hence we don't have to wait on a conditional variable in the caller. Change-Id: Ie83894aa6fc02cc3a973930e67ae2b35de3b7647 BUG: 767862 Signed-off-by: Raghavendra G <raghavendra@gluster.com> Reviewed-on: http://review.gluster.com/2870 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Amar Tumballi <amarts@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.c36
-rw-r--r--xlators/mount/fuse/src/fuse-bridge.h3
2 files changed, 2 insertions, 37 deletions
diff --git a/xlators/mount/fuse/src/fuse-bridge.c b/xlators/mount/fuse/src/fuse-bridge.c
index 3f3962cbc..96b3e5f55 100644
--- a/xlators/mount/fuse/src/fuse-bridge.c
+++ b/xlators/mount/fuse/src/fuse-bridge.c
@@ -3665,12 +3665,6 @@ fuse_graph_switch_task (void *data)
fuse_handle_blocked_locks (args->this, args->old_subvol,
args->new_subvol);
- pthread_mutex_lock (&args->lock);
- {
- args->complete = 1;
- pthread_cond_broadcast (&args->cond);
- }
- pthread_mutex_unlock (&args->lock);
out:
return 0;
}
@@ -3686,9 +3680,6 @@ fuse_graph_switch_args_alloc (void)
goto out;
}
- pthread_cond_init (&args->cond, NULL);
- pthread_mutex_init (&args->lock, NULL);
-
out:
return args;
}
@@ -3701,22 +3692,12 @@ fuse_graph_switch_args_destroy (fuse_graph_switch_args_t *args)
goto out;
}
- pthread_cond_destroy (&args->cond);
- pthread_mutex_destroy (&args->lock);
-
GF_FREE (args);
out:
return;
}
-static int
-fuse_graph_switch_complete (int ret, call_frame_t *frame, void *data)
-{
- return 0;
-}
-
-
int
fuse_handle_graph_switch (xlator_t *this, xlator_t *old_subvol,
xlator_t *new_subvol)
@@ -3739,27 +3720,14 @@ fuse_handle_graph_switch (xlator_t *this, xlator_t *old_subvol,
args->old_subvol = old_subvol;
args->new_subvol = new_subvol;
- ret = synctask_new (this->ctx->env, fuse_graph_switch_task,
- fuse_graph_switch_complete, frame, args);
+ ret = synctask_new (this->ctx->env, fuse_graph_switch_task, NULL, frame,
+ args);
if (ret == -1) {
gf_log (this->name, GF_LOG_WARNING, "starting sync-task to "
"handle graph switch failed");
goto out;
}
- pthread_mutex_lock (&args->lock);
- {
- while (!args->complete) {
- ret = pthread_cond_wait (&args->cond, &args->lock);
- if (ret != 0) {
- gf_log (this->name, GF_LOG_WARNING,
- "cond_wait failed ret:%d errno:%d", ret,
- errno);
- }
- }
- }
- pthread_mutex_unlock (&args->lock);
-
ret = 0;
out:
if (args != NULL) {
diff --git a/xlators/mount/fuse/src/fuse-bridge.h b/xlators/mount/fuse/src/fuse-bridge.h
index b7f0dfd50..4b4307a30 100644
--- a/xlators/mount/fuse/src/fuse-bridge.h
+++ b/xlators/mount/fuse/src/fuse-bridge.h
@@ -123,9 +123,6 @@ struct fuse_graph_switch_args {
xlator_t *this;
xlator_t *old_subvol;
xlator_t *new_subvol;
- pthread_cond_t cond;
- pthread_mutex_t lock;
- char complete;
};
typedef struct fuse_graph_switch_args fuse_graph_switch_args_t;