summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-common.c
diff options
context:
space:
mode:
authorRavishankar N <ravishankar@redhat.com>2014-05-16 15:41:33 +0530
committerPranith Kumar Karampuri <pkarampu@redhat.com>2014-05-17 01:46:17 -0700
commitf4a391e5a44950b0468af082255b9f5abf52b10b (patch)
treec0ad8e56213dbe845b29f834330092650d51d207 /xlators/cluster/afr/src/afr-common.c
parent6a9a52c932bc5be469af119e5b0b3afb8046f625 (diff)
cluster/afr: move messages to new logging framework
Change important (from a diagnostics point of view) log messages to use the gf_msg() framework. Change-Id: I0a58184bbb78989db149e67f07c140a21c781bc2 BUG: 1075611 Signed-off-by: Ravishankar N <ravishankar@redhat.com> Reviewed-on: http://review.gluster.org/7784 Reviewed-by: Krutika Dhananjay <kdhananj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Tested-by: Pranith Kumar Karampuri <pkarampu@redhat.com>
Diffstat (limited to 'xlators/cluster/afr/src/afr-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-common.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/xlators/cluster/afr/src/afr-common.c b/xlators/cluster/afr/src/afr-common.c
index 4c7692bd671..11aae4617e7 100644
--- a/xlators/cluster/afr/src/afr-common.c
+++ b/xlators/cluster/afr/src/afr-common.c
@@ -46,7 +46,7 @@
#include "afr-transaction.h"
#include "afr-self-heal.h"
#include "afr-self-heald.h"
-
+#include "afr-messages.h"
call_frame_t *
afr_copy_frame (call_frame_t *base)
@@ -3178,8 +3178,8 @@ afr_notify (xlator_t *this, int32_t event,
*/
idx = find_child_index (this, data);
if (idx < 0) {
- gf_log (this->name, GF_LOG_ERROR, "Received child_up "
- "from invalid subvolume");
+ gf_msg (this->name, GF_LOG_ERROR, 0, AFR_MSG_INVALID_CHILD_UP,
+ "Received child_up from invalid subvolume");
goto out;
}
@@ -3207,7 +3207,8 @@ afr_notify (xlator_t *this, int32_t event,
if (priv->child_up[i] == 1)
up_children++;
if (up_children == 1) {
- gf_log (this->name, GF_LOG_INFO,
+ gf_msg (this->name, GF_LOG_INFO, 0,
+ AFR_MSG_SUBVOL_UP,
"Subvolume '%s' came back up; "
"going online.", ((xlator_t *)data)->name);
} else {
@@ -3245,7 +3246,8 @@ afr_notify (xlator_t *this, int32_t event,
if (priv->child_up[i] == 0)
down_children++;
if (down_children == priv->child_count) {
- gf_log (this->name, GF_LOG_ERROR,
+ gf_msg (this->name, GF_LOG_ERROR, 0,
+ AFR_MSG_ALL_SUBVOLS_DOWN,
"All subvolumes are down. Going offline "
"until atleast one of them comes back up.");
} else {
@@ -3286,10 +3288,11 @@ afr_notify (xlator_t *this, int32_t event,
if (priv->quorum_count) {
has_quorum = afr_has_quorum (priv->child_up, this);
if (!had_quorum && has_quorum)
- gf_log (this->name, GF_LOG_INFO, "Client-quorum"
- " is met");
+ gf_msg (this->name, GF_LOG_INFO, 0, AFR_MSG_QUORUM_MET,
+ "Client-quorum is met");
if (had_quorum && !has_quorum)
- gf_log (this->name, GF_LOG_WARNING,
+ gf_msg (this->name, GF_LOG_WARNING, 0,
+ AFR_MSG_QUORUM_FAIL,
"Client-quorum is not met");
}