From 19264ccb20070798121d2ebfb3a0d2b1fb7a03bb Mon Sep 17 00:00:00 2001 From: Kotresh HR Date: Mon, 2 May 2016 15:33:13 +0530 Subject: features/bitrot: Fix Compilation Warning!!! Earlier the lock was using glusterfs macros LOCK/UNLOCK/LOCK_INIT/LOCK_DESTROY. The patch http://review.gluster.org/#/c/14140/ used 'pthread_cleanup_push' interface for the same lock which was giving "initialization discards qualifiers from pointer target type". It's strange that the build succeeded in master branch with no warnings but fails for the backport http://review.gluster.org/#/c/14140/ in 3.7 branch treating this warning as error. Change-Id: I75c8a65a2bfb1147fe9a84cfd8f09a97c089ae70 BUG: 1332134 Signed-off-by: Kotresh HR Reviewed-on: http://review.gluster.org/14146 NetBSD-regression: NetBSD Build System CentOS-regression: Gluster Build System Smoke: Gluster Build System Reviewed-by: Jeff Darcy --- xlators/features/bit-rot/src/bitd/bit-rot-scrub.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'xlators/features/bit-rot/src/bitd/bit-rot-scrub.c') diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c index c0421d0ac02..8c88d62eceb 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c +++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c @@ -637,12 +637,12 @@ br_fsscanner_wait_until_kicked (xlator_t *this, br_child_t *child) /* Child lock is to synchronize with disconnect events */ pthread_cleanup_push (_br_lock_cleaner, &child->lock); - LOCK (&child->lock); + pthread_mutex_lock (&child->lock); { scrub_monitor->active_child_count++; br_child_set_scrub_state (child, _gf_true); } - UNLOCK (&child->lock); + pthread_mutex_unlock (&child->lock); pthread_cleanup_pop (0); } pthread_mutex_unlock (&scrub_monitor->wakelock); @@ -719,11 +719,11 @@ br_fsscanner_exit_control (xlator_t *this, br_child_t *child) { scrub_monitor->active_child_count--; pthread_cleanup_push (_br_lock_cleaner, &child->lock); - LOCK (&child->lock); + pthread_mutex_lock (&child->lock); { br_child_set_scrub_state (child, _gf_false); } - UNLOCK (&child->lock); + pthread_mutex_unlock (&child->lock); pthread_cleanup_pop (0); if (scrub_monitor->active_child_count == 0) { -- cgit