From 80e2bfb8e4aaf5e7ae6647f2df4be1af80ee8b0a Mon Sep 17 00:00:00 2001 From: Pranith Kumar K Date: Thu, 22 Jul 2010 05:51:16 +0000 Subject: 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 Signed-off-by: Anand V. Avati BUG: 1037 (selfheal information in normal logging mode) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1037 --- xlators/cluster/afr/src/afr-self-heal-common.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'xlators/cluster/afr/src/afr-self-heal-common.c') diff --git a/xlators/cluster/afr/src/afr-self-heal-common.c b/xlators/cluster/afr/src/afr-self-heal-common.c index 70b6cf851..365c54fb5 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"); + } +} -- cgit