summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2015-06-04 08:50:48 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-06-25 04:45:19 -0700
commit6ab37f0cb4fd8313dab93360a41acbaf422f39b5 (patch)
tree7ecc921307f5fd083e1ef5f37d1728ecca9140f2 /xlators/features/changelog
parent367049879e149e2cd3ec3ba96de7f495a30de180 (diff)
features/bitrot: cleanup, v2
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: 1231619 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/11148 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
Diffstat (limited to 'xlators/features/changelog')
-rw-r--r--xlators/features/changelog/src/changelog-helpers.c30
1 files changed, 4 insertions, 26 deletions
diff --git a/xlators/features/changelog/src/changelog-helpers.c b/xlators/features/changelog/src/changelog-helpers.c
index 54a658f24a3..4d7cb4785c7 100644
--- a/xlators/features/changelog/src/changelog-helpers.c
+++ b/xlators/features/changelog/src/changelog-helpers.c
@@ -22,28 +22,6 @@
#include "changelog-rpc-common.h"
#include <pthread.h>
-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)
{
@@ -1333,7 +1311,7 @@ changelog_rollover (void *data)
continue;
}
- __mask_cancellation (this);
+ _mask_cancellation ();
LOCK (&priv->lock);
{
@@ -1343,7 +1321,7 @@ changelog_rollover (void *data)
}
UNLOCK (&priv->lock);
- __unmask_cancellation (this);
+ _unmask_cancellation ();
}
return NULL;
@@ -1371,14 +1349,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;