summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPranith Kumar K <pkarampu@redhat.com>2016-01-08 13:06:27 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2016-03-06 23:19:26 -0800
commit7d94b3a9333c3f85a67e5d6d09baa12f1cf54e85 (patch)
treec11df2c0a44c5a6681c2d148d9971113d80dbd32
parent4db07c413c9517d5c83499e599be18b3162f5343 (diff)
cluster/afr: Move remaining gf_logs to gf_msgs
>Change-Id: I48d9e5313bd3ccf9fe26c90a7051a8a174d75c49 >BUG: 1296818 >Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> >Reviewed-on: http://review.gluster.org/13195 >Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> >Smoke: Gluster Build System <jenkins@build.gluster.com> >NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> >CentOS-regression: Gluster Build System <jenkins@build.gluster.com> >Reviewed-by: Vijay Bellur <vbellur@redhat.com> BUG: 1315142 Change-Id: Iab55c3fd41777e9fe295f674c3ee410fd780b418 Signed-off-by: Pranith Kumar K <pkarampu@redhat.com> Reviewed-on: http://review.gluster.org/13617 Smoke: Gluster Build System <jenkins@build.gluster.com> NetBSD-regression: NetBSD Build System <jenkins@build.gluster.org> CentOS-regression: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com>
-rw-r--r--xlators/cluster/afr/src/afr-common.c13
-rw-r--r--xlators/cluster/afr/src/afr-inode-read.c6
-rw-r--r--xlators/cluster/afr/src/afr-inode-write.c14
3 files changed, 19 insertions, 14 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 96ed41d3abf..36c22ad7dc0 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -479,8 +479,9 @@ afr_spb_choice_timeout_cancel (xlator_t *this, inode_t *inode)
{
__afr_inode_ctx_get (this, inode, &ctx);
if (!ctx) {
- gf_log (this->name, GF_LOG_WARNING, "Failed to cancel"
- " split-brain choice timer.");
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ AFR_MSG_SPLIT_BRAIN_CHOICE_ERROR,
+ "Failed to cancel split-brain choice timer.");
goto out;
}
ctx->spb_choice = -1;
@@ -535,7 +536,8 @@ afr_set_split_brain_choice (int ret, call_frame_t *frame, void *opaque)
goto out;
if (!(data->d_spb || data->m_spb)) {
- gf_log (this->name, GF_LOG_WARNING, "Cannot set "
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ AFR_MSG_SPLIT_BRAIN_CHOICE_ERROR, "Cannot set "
"replica.split-brain-choice on %s. File is"
" not in data/metadata split-brain.",
uuid_utoa (loc->gfid));
@@ -548,8 +550,9 @@ afr_set_split_brain_choice (int ret, call_frame_t *frame, void *opaque)
{
ret = __afr_inode_ctx_get (this, inode, &ctx);
if (ret) {
- gf_log (this->name, GF_LOG_ERROR, "Failed to get"
- "inode_ctx for %s", loc->name);
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ AFR_MSG_SPLIT_BRAIN_CHOICE_ERROR,
+ "Failed to get inode_ctx for %s", loc->name);
goto unlock;
}
diff --git a/xlators/cluster/afr/src/afr-inode-read.c b/xlators/cluster/afr/src/afr-inode-read.c
index 6afd51dfb4e..e58780c44b0 100644
--- a/xlators/cluster/afr/src/afr-inode-read.c
+++ b/xlators/cluster/afr/src/afr-inode-read.c
@@ -740,9 +740,9 @@ afr_getxattr_node_uuid_cbk (call_frame_t *frame, void *cookie,
if (++curr_call_child == priv->child_count)
goto unwind;
- gf_log (this->name, GF_LOG_WARNING,
- "op_ret (-1): Re-querying afr-child (%d/%d)",
- curr_call_child, priv->child_count);
+ gf_msg_debug (this->name, op_errno,
+ "op_ret (-1): Re-querying afr-child (%d/%d)",
+ curr_call_child, priv->child_count);
unwind = 0;
STACK_WIND_COOKIE (frame, afr_getxattr_node_uuid_cbk,
diff --git a/xlators/cluster/afr/src/afr-inode-write.c b/xlators/cluster/afr/src/afr-inode-write.c
index 88f885d3422..8069d6cc3b3 100644
--- a/xlators/cluster/afr/src/afr-inode-write.c
+++ b/xlators/cluster/afr/src/afr-inode-write.c
@@ -1116,7 +1116,8 @@ _afr_handle_replace_brick_type (xlator_t *this, call_frame_t *frame,
}
if (!count) {
- gf_log (this->name, GF_LOG_ERROR, "Couldn't acquire lock on"
+ gf_msg (this->name, GF_LOG_ERROR, EAGAIN,
+ AFR_MSG_REPLACE_BRICK_STATUS, "Couldn't acquire lock on"
" any child.");
ret = -EAGAIN;
goto unlock;
@@ -1174,8 +1175,8 @@ _afr_handle_replace_brick (void *opaque)
loc_copy (&local->loc, &data->loc);
- gf_log (this->name, GF_LOG_DEBUG, "Child being replaced is : %s",
- priv->children[rb_index]->name);
+ gf_msg_debug (this->name, 0, "Child being replaced is : %s",
+ priv->children[rb_index]->name);
ret = _afr_handle_replace_brick_type (this, frame, &local->loc, rb_index,
AFR_METADATA_TRANSACTION);
@@ -1425,9 +1426,10 @@ afr_handle_replace_brick (xlator_t *this, call_frame_t *frame, loc_t *loc,
if (!ret) {
if (frame->root->pid != GF_CLIENT_PID_SELF_HEALD) {
- gf_log (this->name, GF_LOG_ERROR, "'%s' is an internal"
- " extended attribute : %s.",
- GF_AFR_REPLACE_BRICK, strerror (EPERM));
+ gf_msg (this->name, GF_LOG_ERROR, EPERM,
+ AFR_MSG_REPLACE_BRICK_STATUS, "'%s' is an "
+ "internal extended attribute",
+ GF_AFR_REPLACE_BRICK);
ret = 1;
goto out;
}