summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-utils.c
diff options
context:
space:
mode:
authorGaurav <gaurav@gluster.com>2011-01-31 04:25:38 +0000
committerAnand V. Avati <avati@dev.gluster.com>2011-02-04 00:39:26 -0800
commit5f8e2cab86eab7f5ee5b4bb9b649376e476c740c (patch)
tree2a40f4806584dbafe1e0c2d44dbb509de28cbeb4 /xlators/mgmt/glusterd/src/glusterd-utils.c
parentf3648c88ebc6d58a10854d564d3fc2c82290ce13 (diff)
Logging : Use of uuid_utoa and uuid_utoa_r.
Signed-off-by: Gaurav <gaurav@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 2308 (Threadsafe uuid to string conversion function) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2308
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-utils.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-utils.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-utils.c b/xlators/mgmt/glusterd/src/glusterd-utils.c
index db0b0b385c5..0fac9e3b402 100644
--- a/xlators/mgmt/glusterd/src/glusterd-utils.c
+++ b/xlators/mgmt/glusterd/src/glusterd-utils.c
@@ -224,15 +224,14 @@ glusterd_lock (uuid_t uuid)
int ret = -1;
GF_ASSERT (uuid);
- uuid_unparse (uuid, new_owner_str);
glusterd_get_lock_owner (&owner);
if (!uuid_is_null (owner)) {
- uuid_unparse (owner, owner_str);
gf_log ("glusterd", GF_LOG_ERROR, "Unable to get lock"
- " for uuid: %s, lock held by: %s", new_owner_str,
- owner_str);
+ " for uuid: %s, lock held by: %s",
+ uuid_utoa_r (uuid, new_owner_str),
+ uuid_utoa_r (owner, owner_str));
goto out;
}
@@ -240,7 +239,7 @@ glusterd_lock (uuid_t uuid)
if (!ret) {
gf_log ("glusterd", GF_LOG_NORMAL, "Cluster lock held by"
- " %s", new_owner_str);
+ " %s", uuid_utoa (uuid));
}
out:
@@ -257,7 +256,6 @@ glusterd_unlock (uuid_t uuid)
int32_t ret = -1;
GF_ASSERT (uuid);
- uuid_unparse (uuid, new_owner_str);
glusterd_get_lock_owner (&owner);
@@ -269,9 +267,9 @@ glusterd_unlock (uuid_t uuid)
ret = uuid_compare (uuid, owner);
if (ret) {
- uuid_unparse (owner, owner_str);
gf_log ("glusterd", GF_LOG_ERROR, "Cluster lock held by %s"
- " ,unlock req from %s!", owner_str, new_owner_str);
+ " ,unlock req from %s!", uuid_utoa_r (owner ,owner_str)
+ , uuid_utoa_r (uuid, new_owner_str));
goto out;
}
@@ -1224,7 +1222,6 @@ glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo,
char key[512] = {0,};
glusterd_brickinfo_t *brickinfo = NULL;
int32_t i = 1;
- char uuid_str[50] = {0,};
char *volume_id_str = NULL;
glusterd_volopt_ctx_t ctx = {0};
@@ -1272,8 +1269,7 @@ glusterd_add_volume_to_dict (glusterd_volinfo_t *volinfo,
if (ret)
goto out;
- uuid_unparse (volinfo->volume_id, uuid_str);
- volume_id_str = gf_strdup (uuid_str);
+ volume_id_str = gf_strdup (uuid_utoa (volinfo->volume_id));
if (!volume_id_str)
goto out;