summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/afr/src/afr-self-heal-common.c
diff options
context:
space:
mode:
authorPranith Kumar K <pranithk@gluster.com>2010-07-22 05:51:16 +0000
committerAnand V. Avati <avati@dev.gluster.com>2010-07-23 04:28:57 -0700
commit80e2bfb8e4aaf5e7ae6647f2df4be1af80ee8b0a (patch)
tree0b2e6ebe74c43dc3af77a8cac2e451aea7623e81 /xlators/cluster/afr/src/afr-self-heal-common.c
parentdbab7f87b6fbcc4d1f518e6f98101331df51ce4a (diff)
custer/afr added self-heal logging in normal mode
Changes are made such that self heal messages are printed (filename, type of selfheal such as data/meatadata/entry selfheal and the cause which triggered the selfheal) in the log file when run in normal mode. Signed-off-by: Pranith Kumar K <pranithk@gluster.com> Signed-off-by: Anand V. Avati <avati@dev.gluster.com> BUG: 1037 (selfheal information in normal logging mode) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1037
Diffstat (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c')
-rw-r--r--xlators/cluster/afr/src/afr-self-heal-common.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c
index 70b6cf85153..365c54fb5d4 100644
--- a/xlators/cluster/afr/src/afr-self-heal-common.c
+++ b/xlators/cluster/afr/src/afr-self-heal-common.c
@@ -1619,3 +1619,24 @@ afr_self_heal (call_frame_t *frame, xlator_t *this)
return 0;
}
+
+void
+afr_self_heal_type_str_get (afr_self_heal_t *self_heal_p, char *str,
+ size_t size)
+{
+ assert(str && (size > 0));
+
+ if (self_heal_p->need_metadata_self_heal) {
+ snprintf(str, size, " meta-data");
+ }
+
+ if (self_heal_p->need_data_self_heal) {
+ snprintf(str + strlen(str), size - strlen(str),
+ " data");
+ }
+
+ if (self_heal_p->need_entry_self_heal) {
+ snprintf(str + strlen(str), size - strlen(str),
+ " entry");
+ }
+}