diff options
Diffstat (limited to 'xlators/features/bit-rot')
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot-scrub.c | 8 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot.c | 16 | ||||
-rw-r--r-- | xlators/features/bit-rot/src/bitd/bit-rot.h | 2 |
3 files changed, 13 insertions, 13 deletions
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) { diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.c b/xlators/features/bit-rot/src/bitd/bit-rot.c index 7d337bf724f..ed436c34dc4 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); diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.h b/xlators/features/bit-rot/src/bitd/bit-rot.h index b3d1569ba54..4153d0e4724 100644 --- a/xlators/features/bit-rot/src/bitd/bit-rot.h +++ b/xlators/features/bit-rot/src/bitd/bit-rot.h @@ -75,7 +75,7 @@ typedef enum br_child_state { } br_child_state_t; struct br_child { - gf_lock_t lock; /* protects child state */ + pthread_mutex_t lock; /* protects child state */ char witnessed; /* witnessed at least one succesfull connection */ br_child_state_t c_state; /* current state of this child */ |