diff options
| author | Mohamed Ashiq <ashiq333@gmail.com> | 2015-05-19 15:21:46 +0530 |
|---|---|---|
| committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-07-09 00:10:20 -0700 |
| commit | 8c20f8bd0be0a797f57a5e68473d857357a16f9e (patch) | |
| tree | b8f412a40509668649329e8133888432c326310d /libglusterfs/src/quota-common-utils.c | |
| parent | 30926da5426f95a5eaf0b3f0e61f7ef4172daa36 (diff) | |
event,parse-utils,quota-common-utils,rbthash/libglusterfs : Porting to new logging framework
Backport of http://review.gluster.org/10823
Cherry-picked from a9b6933ef097d2a81ce21a8aeda2acc569cd1509
>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>
Change-Id: I13ae9a97fe442c06cf50fe77c63718ea0858dc4d
BUG: 1217722
Signed-off-by: Mohamed Ashiq <ashiq333@gmail.com>
Reviewed-on: http://review.gluster.org/11404
Tested-by: Gluster Build System <jenkins@build.gluster.com>
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.c | 29 |
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; } |
