diff options
| author | arao <arao@redhat.com> | 2015-03-06 12:33:05 +0530 |
|---|---|---|
| committer | Pranith Kumar Karampuri <pkarampu@redhat.com> | 2015-06-28 23:15:44 -0700 |
| commit | 10dfc9b4d4d04314ccd0f6a4eb0ee0341fd91e0d (patch) | |
| tree | 2564ca15673b2ea186fc707817439f1edd1316ce /xlators/cluster/afr/src/afr-inode-read.c | |
| parent | fedcdc8a1749ca5074576e2307fab669808d73bc (diff) | |
afr: Porting messages to new logging framework
updated
Backport of http://review.gluster.org/9897
Cherry picked from 58a736111fa1db4f10c6646e81066434260f674f
>Change-Id: I94ac7b2cb0d43a82cf0eeee21407cff9b575c458
>BUG: 1194640
>Signed-off-by: arao <arao@redhat.com>
>Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com>
>Reviewed-on: http://review.gluster.org/9897
>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>
Change-Id: I5fb464da38594579f31661b42a8a3e9d858a797e
BUG: 1217722
Signed-off-by: arao <arao@redhat.com>
Signed-off-by: Mohamed Ashiq <mliyazud@redhat.com>
Reviewed-on: http://review.gluster.org/11351
Tested-by: NetBSD Build System <jenkins@build.gluster.org>
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anuradha Talur <atalur@redhat.com>
Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-read.c')
| -rw-r--r-- | xlators/cluster/afr/src/afr-inode-read.c | 47 |
1 files changed, 24 insertions, 23 deletions
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c index 7fed62a5361..1ebe5e5caf8 100644 --- a/xlators/cluster/afr/src/afr-inode-read.c +++ b/xlators/cluster/afr/src/afr-inode-read.c @@ -38,6 +38,7 @@ #include "quota-common-utils.h" #include "afr-transaction.h" +#include "afr-messages.h" /* * Quota size xattrs are not maintained by afr. There is a @@ -594,8 +595,6 @@ unlock: if (ret) { op_ret = -1; op_errno = ENOMEM; - gf_log (this->name, GF_LOG_ERROR, - "Error serializing dictionary"); goto unwind; } if (serz_len == -1) @@ -606,7 +605,8 @@ unlock: if (ret) { op_ret = -1; op_errno = ENOMEM; - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, + ENOMEM, AFR_MSG_DICT_SET_FAILED, "Error setting dictionary"); goto unwind; } @@ -682,8 +682,6 @@ unlock: if (ret) { op_ret = -1; op_errno = ENOMEM; - gf_log (this->name, GF_LOG_ERROR, - "Error serializing dictionary"); goto unwind; } if (serz_len == -1) @@ -694,7 +692,8 @@ unlock: if (ret) { op_ret = -1; op_errno = ENOMEM; - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, + ENOMEM, AFR_MSG_DICT_SET_FAILED, "Error setting dictionary"); goto unwind; } @@ -1047,7 +1046,8 @@ afr_fgetxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, int32_t tlen = 0; if (!frame || !frame->local || !this) { - gf_log ("", GF_LOG_ERROR, "possible NULL deref"); + gf_msg ("", GF_LOG_ERROR, 0, + AFR_MSG_INVALID_ARG, "possible NULL deref"); goto out; } @@ -1086,7 +1086,8 @@ afr_fgetxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, ret = dict_set_dynstr (local->dict, xattr_cky, xattr); if (ret) { - gf_log (this->name, GF_LOG_ERROR, + gf_msg (this->name, GF_LOG_ERROR, + -ret, AFR_MSG_DICT_SET_FAILED, "Cannot set xattr cookie key"); goto unlock; } @@ -1127,8 +1128,6 @@ unlock: + strlen (xattr_serz), &tlen, ' '); if (ret) { - gf_log (this->name, GF_LOG_ERROR, "Error serializing" - " dictionary"); goto unwind; } @@ -1139,8 +1138,9 @@ unlock: ret = dict_set_dynstr (nxattr, local->cont.getxattr.name, xattr_serz); if (ret) - gf_log (this->name, GF_LOG_ERROR, "Cannot set pathinfo" - " key in dict"); + gf_msg (this->name, GF_LOG_ERROR, + -ret, AFR_MSG_DICT_SET_FAILED, + "Cannot set pathinfo key in dict"); unwind: AFR_STACK_UNWIND (fgetxattr, frame, local->op_ret, @@ -1171,7 +1171,8 @@ afr_getxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, int32_t tlen = 0; if (!frame || !frame->local || !this) { - gf_log ("", GF_LOG_ERROR, "possible NULL deref"); + gf_msg ("", GF_LOG_ERROR, 0, + AFR_MSG_INVALID_ARG, "possible NULL deref"); goto out; } @@ -1210,8 +1211,11 @@ afr_getxattr_pathinfo_cbk (call_frame_t *frame, void *cookie, ret = dict_set_dynstr (local->dict, xattr_cky, xattr); if (ret) { - gf_log (this->name, GF_LOG_ERROR, - "Cannot set xattr cookie key"); + gf_msg (this->name, GF_LOG_ERROR, + -ret, + AFR_MSG_DICT_SET_FAILED, + "Cannot set xattr " + "cookie key"); goto unlock; } @@ -1248,8 +1252,6 @@ unlock: xattr_serz + strlen (xattr_serz), &tlen, ' '); if (ret) { - gf_log (this->name, GF_LOG_ERROR, "Error serializing" - " dictionary"); goto unwind; } @@ -1260,8 +1262,9 @@ unlock: ret = dict_set_dynstr (nxattr, local->cont.getxattr.name, xattr_serz); if (ret) - gf_log (this->name, GF_LOG_ERROR, "Cannot set pathinfo" - " key in dict"); + gf_msg (this->name, GF_LOG_ERROR, + -ret, AFR_MSG_DICT_SET_FAILED, + "Cannot set pathinfo key in dict"); unwind: AFR_STACK_UNWIND (getxattr, frame, local->op_ret, @@ -1295,7 +1298,8 @@ afr_common_getxattr_stime_cbk (call_frame_t *frame, void *cookie, int32_t callcnt = 0; if (!frame || !frame->local || !this) { - gf_log ("", GF_LOG_ERROR, "possible NULL deref"); + gf_msg ("", GF_LOG_ERROR, 0, + AFR_MSG_INVALID_ARG, "possible NULL deref"); goto out; } @@ -1465,9 +1469,6 @@ afr_getxattr (call_frame_t *frame, xlator_t *this, if (!strncmp (name, AFR_XATTR_PREFIX, strlen (AFR_XATTR_PREFIX))) { - gf_log (this->name, GF_LOG_INFO, - "%s: no data present for key %s", - loc->path, name); op_errno = ENODATA; goto out; } |
