From 1e5653165a97999288cbf40e670d6c84a31ad3f6 Mon Sep 17 00:00:00 2001 From: Raghavendra G Date: Mon, 5 Mar 2012 15:15:04 +0530 Subject: 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 Reviewed-on: http://review.gluster.com/2870 Tested-by: Gluster Build System Reviewed-by: Amar Tumballi Reviewed-by: Vijay Bellur --- xlators/mount/fuse/src/fuse-bridge.c | 36 ++---------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) (limited to 'xlators/mount/fuse/src/fuse-bridge.c') 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) { -- cgit