summaryrefslogtreecommitdiffstats
path: root/libglusterfs
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2015-06-04 08:50:48 +0530
committerRaghavendra Bhat <raghavendra@redhat.com>2015-07-09 03:13:25 -0700
commit2874ee4d65185a607f1f646fc88ba8eb400aaa9a (patch)
tree3f4e47fbf09c2505e5ef7558d9fbb8ffcc684148 /libglusterfs
parent291aba1f1ba33831569acd879e3357c1fd01a5c8 (diff)
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 <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/11540 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Tested-by: Gluster Build System <jenkins@build.gluster.com>
Diffstat (limited to 'libglusterfs')
-rw-r--r--libglusterfs/src/common-utils.c11
-rw-r--r--libglusterfs/src/common-utils.h3
2 files changed, 14 insertions, 0 deletions
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 851edad6667..284c444ccfd 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -4019,3 +4019,14 @@ out:
return ret;
}
+void
+_mask_cancellation (void)
+{
+ (void) pthread_setcancelstate (PTHREAD_CANCEL_DISABLE, NULL);
+}
+
+void
+_unmask_cancellation (void)
+{
+ (void) pthread_setcancelstate (PTHREAD_CANCEL_ENABLE, NULL);
+}
diff --git a/libglusterfs/src/common-utils.h b/libglusterfs/src/common-utils.h
index 43ff5d78cf4..5302a47cb1d 100644
--- a/libglusterfs/src/common-utils.h
+++ b/libglusterfs/src/common-utils.h
@@ -764,4 +764,7 @@ gf_nread (int fd, void *buf, size_t count);
ssize_t
gf_nwrite (int fd, const void *buf, size_t count);
+void _mask_cancellation (void);
+void _unmask_cancellation (void);
+
#endif /* _COMMON_UTILS_H */