summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/quota-common-utils.c
diff options
context:
space:
mode:
authorMohamed Ashiq <ashiq333@gmail.com>2015-05-19 15:21:46 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2015-06-24 23:29:28 -0700
commita9b6933ef097d2a81ce21a8aeda2acc569cd1509 (patch)
treeca91427bc1ddeb0b37590c9a999a0048900e1579 /libglusterfs/src/quota-common-utils.c
parent6853d5091dd52059490e5e548c06faf1306079df (diff)
event,parse-utils,quota-common-utils,rbthash/libglusterfs : Porting to new logging framework
Change-Id: I13ae9a97fe442c06cf50fe77c63718ea0858dc4d BUG: 1194640 Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com> Reviewed-on: http://review.gluster.org/10823 Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'libglusterfs/src/quota-common-utils.c')
-rw-r--r--libglusterfs/src/quota-common-utils.c29
1 files changed, 17 insertions, 12 deletions
diff --git a/libglusterfs/src/quota-common-utils.c b/libglusterfs/src/quota-common-utils.c
index 012f80fab48..8c528c8bd3b 100644
--- a/libglusterfs/src/quota-common-utils.c
+++ b/libglusterfs/src/quota-common-utils.c
@@ -14,6 +14,7 @@
#include "byte-order.h"
#include "quota-common-utils.h"
#include "common-utils.h"
+#include "libglusterfs-messages.h"
int32_t
quota_data_to_meta (data_t *data, char *key, quota_meta_t *meta)
@@ -42,8 +43,9 @@ quota_data_to_meta (data_t *data, char *key, quota_meta_t *meta)
* Older version of glusterfs will not have inode count.
* Return failure, this will be healed as part of lookup
*/
- gf_log_callingfn ("quota", GF_LOG_DEBUG, "Object quota xattrs "
- "missing: len = %d", data->len);
+ gf_msg_callingfn ("quota", GF_LOG_DEBUG, 0,
+ LG_MSG_QUOTA_XATTRS_MISSING, "Object quota "
+ "xattrs missing: len = %d", data->len);
ret = -2;
goto out;
}
@@ -83,8 +85,6 @@ quota_dict_set_meta (dict_t *dict, char *key, const quota_meta_t *meta,
value = GF_CALLOC (1, sizeof (quota_meta_t), gf_common_quota_meta_t);
if (value == NULL) {
- gf_log_callingfn ("quota", GF_LOG_ERROR,
- "Memory allocation failed");
goto out;
}
@@ -105,7 +105,8 @@ quota_dict_set_meta (dict_t *dict, char *key, const quota_meta_t *meta,
}
if (ret < 0) {
- gf_log_callingfn ("quota", GF_LOG_ERROR, "dict set failed");
+ gf_msg_callingfn ("quota", GF_LOG_ERROR, 0,
+ LG_MSG_DICT_SET_FAILED, "dict set failed");
GF_FREE (value);
}
@@ -133,7 +134,8 @@ quota_conf_read_header (int fd, char *buf)
out:
if (ret < 0)
- gf_log_callingfn ("quota", GF_LOG_ERROR, "failed to read "
+ gf_msg_callingfn ("quota", GF_LOG_ERROR, 0,
+ LG_MSG_QUOTA_CONF_ERROR, "failed to read "
"header from a quota conf");
return ret;
@@ -159,8 +161,9 @@ quota_conf_read_version (int fd, float *version)
value = strtof ((buf + strlen(buf) - 3), &tail);
if (tail[0] != '\0') {
ret = -1;
- gf_log_callingfn ("quota", GF_LOG_ERROR, "invalid quota conf "
- "version");
+ gf_msg_callingfn ("quota", GF_LOG_ERROR, 0,
+ LG_MSG_QUOTA_CONF_ERROR, "invalid quota conf"
+ " version");
goto out;
}
@@ -170,8 +173,9 @@ out:
if (ret >= 0)
*version = value;
else
- gf_log_callingfn ("quota", GF_LOG_ERROR, "failed to read "
- "version from a quota conf header");
+ gf_msg_callingfn ("quota", GF_LOG_ERROR, 0,
+ LG_MSG_QUOTA_CONF_ERROR, "failed to "
+ "read version from a quota conf header");
return ret;
}
@@ -203,8 +207,9 @@ quota_conf_read_gfid (int fd, void *buf, char *type, float version)
out:
if (ret < 0)
- gf_log_callingfn ("quota", GF_LOG_ERROR, "failed to read "
- "gfid from a quota conf");
+ gf_msg_callingfn ("quota", GF_LOG_ERROR, 0,
+ LG_MSG_QUOTA_CONF_ERROR, "failed to "
+ "read gfid from a quota conf");
return ret;
}