summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-inode-read.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/cluster/afr/src/afr-inode-read.c')
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c47
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;
}