diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-locks.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-locks.c | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-locks.c b/xlators/mgmt/glusterd/src/glusterd-locks.c index 36da3273f..531e0ba6c 100644 --- a/xlators/mgmt/glusterd/src/glusterd-locks.c +++ b/xlators/mgmt/glusterd/src/glusterd-locks.c @@ -28,7 +28,7 @@ #define MAX_LOCKING_ENTITIES 2 -/* Valid entities that the mgt_v3 lock can hold locks upon * +/* Valid entities that the mgmt_v3 lock can hold locks upon * * To add newer entities to be locked, we can just add more * * entries to this table along with the type and default value */ valid_entities valid_types[] = { @@ -128,12 +128,11 @@ glusterd_release_multiple_locks_per_entity (dict_t *dict, uuid_t uuid, int32_t ret = -1; xlator_t *this = NULL; - GF_ASSERT(THIS); + this = THIS; + GF_ASSERT(this); GF_ASSERT (dict); GF_ASSERT (type); - this = THIS; - if (locked_count == 0) { gf_log (this->name, GF_LOG_DEBUG, "No %s locked as part of this transaction", @@ -186,12 +185,11 @@ glusterd_acquire_multiple_locks_per_entity (dict_t *dict, uuid_t uuid, int32_t locked_count = 0; xlator_t *this = NULL; - GF_ASSERT(THIS); + this = THIS; + GF_ASSERT(this); GF_ASSERT (dict); GF_ASSERT (type); - this = THIS; - /* Locking one element after other */ for (i = 0; i < count; i++) { snprintf (name_buf, sizeof(name_buf), @@ -255,12 +253,11 @@ glusterd_mgmt_v3_unlock_entity (dict_t *dict, uuid_t uuid, char *type, gf_boolean_t hold_locks = _gf_false; xlator_t *this = NULL; - GF_ASSERT(THIS); + this = THIS; + GF_ASSERT(this); GF_ASSERT (dict); GF_ASSERT (type); - this = THIS; - snprintf (name_buf, sizeof(name_buf), "hold_%s_locks", type); hold_locks = dict_get_str_boolean (dict, name_buf, default_value); @@ -328,12 +325,11 @@ glusterd_mgmt_v3_lock_entity (dict_t *dict, uuid_t uuid, char *type, gf_boolean_t hold_locks = _gf_false; xlator_t *this = NULL; - GF_ASSERT(THIS); + this = THIS; + GF_ASSERT(this); GF_ASSERT (dict); GF_ASSERT (type); - this = THIS; - snprintf (name_buf, sizeof(name_buf), "hold_%s_locks", type); hold_locks = dict_get_str_boolean (dict, name_buf, default_value); @@ -395,8 +391,8 @@ glusterd_multiple_mgmt_v3_unlock (dict_t *dict, uuid_t uuid) int32_t op_ret = 0; xlator_t *this = NULL; - GF_ASSERT(THIS); this = THIS; + GF_ASSERT(this); if (!dict) { gf_log (this->name, GF_LOG_ERROR, "dict is null."); @@ -433,8 +429,8 @@ glusterd_multiple_mgmt_v3_lock (dict_t *dict, uuid_t uuid) int32_t locked_count = 0; xlator_t *this = NULL; - GF_ASSERT(THIS); this = THIS; + GF_ASSERT(this); if (!dict) { gf_log (this->name, GF_LOG_ERROR, "dict is null."); @@ -449,7 +445,8 @@ glusterd_multiple_mgmt_v3_lock (dict_t *dict, uuid_t uuid) valid_types[i].type, valid_types[i].default_value); if (ret) { - gf_log (this->name, GF_LOG_ERROR, "Unable to lock all %s", + gf_log (this->name, GF_LOG_ERROR, + "Unable to lock all %s", valid_types[i].type); break; } |