summaryrefslogtreecommitdiffstats
path: root/xlators/features/bit-rot/src/bitd/bit-rot.c
diff options
context:
space:
mode:
authorKotresh HR <khiremat@redhat.com>2016-05-02 15:33:13 +0530
committerJeff Darcy <jdarcy@redhat.com>2016-05-02 11:04:30 -0700
commit19264ccb20070798121d2ebfb3a0d2b1fb7a03bb (patch)
tree419520a9d7d9a717f89bce7c38d8b89b3279a4a1 /xlators/features/bit-rot/src/bitd/bit-rot.c
parent209985e861f4d8a22bfdb457c0e8d7045ab44553 (diff)
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 <khiremat@redhat.com> Reviewed-on: http://review.gluster.org/14146 NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Smoke: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot/src/bitd/bit-rot.c')
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c
index 7d337bf..ed436c3 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot.c
@@ -1092,11 +1092,11 @@ br_oneshot_signer (void *arg)
static void
br_set_child_state (br_child_t *child, br_child_state_t state)
{
- LOCK (&child->lock);
+ pthread_mutex_lock (&child->lock);
{
_br_set_child_state (child, state);
}
- UNLOCK (&child->lock);
+ pthread_mutex_unlock (&child->lock);
}
/**
@@ -1245,7 +1245,7 @@ br_child_enaction (xlator_t *this, br_child_t *child, br_stub_init_t *stub)
int32_t ret = -1;
br_private_t *priv = this->private;
- LOCK (&child->lock);
+ pthread_mutex_lock (&child->lock);
{
if (priv->iamscrubber)
ret = br_enact_scrubber (this, child);
@@ -1260,7 +1260,7 @@ br_child_enaction (xlator_t *this, br_child_t *child, br_stub_init_t *stub)
"Connected to brick %s..", child->brick_path);
}
}
- UNLOCK (&child->lock);
+ pthread_mutex_unlock (&child->lock);
return ret;
}
@@ -1417,7 +1417,7 @@ br_brick_disconnect (xlator_t *this, br_child_t *child)
*/
pthread_mutex_lock (&scrub_monitor->wakelock);
{
- LOCK (&child->lock);
+ pthread_mutex_lock (&child->lock);
{
if (!_br_is_child_connected (child))
goto unblock;
@@ -1431,7 +1431,7 @@ br_brick_disconnect (xlator_t *this, br_child_t *child)
ret = br_cleanup_signer (this, child);
}
unblock:
- UNLOCK (&child->lock);
+ pthread_mutex_unlock (&child->lock);
}
pthread_mutex_unlock (&scrub_monitor->wakelock);
@@ -1863,7 +1863,7 @@ br_free_children (xlator_t *this, br_private_t *priv, int count)
for (--count; count >= 0; count--) {
child = &priv->children[count];
mem_pool_destroy (child->timer_pool);
- LOCK_DESTROY (&child->lock);
+ pthread_mutex_destroy (&child->lock);
}
GF_FREE (priv->children);
@@ -1887,7 +1887,7 @@ br_init_children (xlator_t *this, br_private_t *priv)
while (trav) {
child = &priv->children[i];
- LOCK_INIT (&child->lock);
+ pthread_mutex_init (&child->lock, NULL);
child->witnessed = 0;
br_set_child_state (child, BR_CHILD_STATE_DISCONNECTED);