From 2874ee4d65185a607f1f646fc88ba8eb400aaa9a Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Thu, 4 Jun 2015 08:50:48 +0530 Subject: features/bitrot: cleanup, v2 Backport of http://review.gluster.org/11148 This patch uses "cleanup, v1" infrastrcuture to cleanup scrubber (data structures, threads, timers, etc..) on brick disconnection. Signer is not cleaned up yet: probably would be done as part of another patch. Change-Id: I78a92b8a7f02b2f39078aa9a5a6b101fc499fd70 BUG: 1226666 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/11540 Reviewed-by: Raghavendra Bhat Tested-by: NetBSD Build System Tested-by: Gluster Build System --- xlators/features/changelog/src/changelog-helpers.c | 30 +++------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'xlators/features/changelog') diff --git a/xlators/features/changelog/src/changelog-helpers.c b/xlators/features/changelog/src/changelog-helpers.c index 2c0a6457e8e..144bf542186 100644 --- a/xlators/features/changelog/src/changelog-helpers.c +++ b/xlators/features/changelog/src/changelog-helpers.c @@ -27,28 +27,6 @@ #include "changelog-rpc-common.h" #include -static inline void -__mask_cancellation (xlator_t *this) -{ - int ret = 0; - - ret = pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL); - if (ret) - gf_log (this->name, GF_LOG_WARNING, - "failed to disable thread cancellation"); -} - -static inline void -__unmask_cancellation (xlator_t *this) -{ - int ret = 0; - - ret = pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL); - if (ret) - gf_log (this->name, GF_LOG_WARNING, - "failed to enable thread cancellation"); -} - static void changelog_cleanup_free_mutex (void *arg_mutex) { @@ -1338,7 +1316,7 @@ changelog_rollover (void *data) continue; } - __mask_cancellation (this); + _mask_cancellation (); LOCK (&priv->lock); { @@ -1348,7 +1326,7 @@ changelog_rollover (void *data) } UNLOCK (&priv->lock); - __unmask_cancellation (this); + _unmask_cancellation (); } return NULL; @@ -1376,14 +1354,14 @@ changelog_fsync_thread (void *data) if (ret) continue; - __mask_cancellation (this); + _mask_cancellation (); ret = changelog_inject_single_event (this, priv, &cld); if (ret) gf_log (this->name, GF_LOG_ERROR, "failed to inject fsync event"); - __unmask_cancellation (this); + _unmask_cancellation (); } return NULL; -- cgit