diff options
author | Avra Sengupta <asengupt@redhat.com> | 2014-03-27 00:50:32 +0000 |
---|---|---|
committer | Rajesh Joseph <rjoseph@redhat.com> | 2014-03-27 09:25:56 -0700 |
commit | 42c98f4f1180e8cf91068a70646ca94a70400f2a (patch) | |
tree | 29850c7d81186e08954e6087f52f46c02d86c543 /xlators/mgmt/glusterd/src/glusterd-locks.c | |
parent | 3b2408904dbbfb7987a4792fa71ba3fe61f18398 (diff) |
Review Comments
Change-Id: Ifce90b0b617bc0b43a9af0bd692a7290820ac62c
Signed-off-by: Avra Sengupta <asengupt@redhat.com>
Reviewed-on: http://review.gluster.org/7358
Reviewed-by: Rajesh Joseph <rjoseph@redhat.com>
Tested-by: Rajesh Joseph <rjoseph@redhat.com>
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; } |