cb8e9e
From 8ffb04d40cd838f0a498a4f0c1451a64fc64f65d Mon Sep 17 00:00:00 2001
cb8e9e
From: Venky Shankar <vshankar@redhat.com>
cb8e9e
Date: Thu, 11 Jun 2015 20:19:39 +0530
cb8e9e
Subject: [PATCH 153/190] features/bitrot: log scrub frequency & throttle values
cb8e9e
cb8e9e
    Backport of http://review.gluster.org/11190
cb8e9e
cb8e9e
Change-Id: I56d5236c37a413046b5766320184047a908f2c8d
cb8e9e
BUG: 1225747
cb8e9e
Signed-off-by: Venky Shankar <vshankar@redhat.com>
cb8e9e
Reviewed-on: https://code.engineering.redhat.com/gerrit/51698
cb8e9e
Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com>
cb8e9e
Tested-by: Raghavendra Bhat <raghavendra@redhat.com>
cb8e9e
---
cb8e9e
 xlators/features/bit-rot/src/bitd/bit-rot-scrub.c |   28 +++++++++++++++++++++
cb8e9e
 1 files changed, 28 insertions(+), 0 deletions(-)
cb8e9e
cb8e9e
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
cb8e9e
index 26ad97a..2da4530 100644
cb8e9e
--- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
cb8e9e
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
cb8e9e
@@ -1141,6 +1141,32 @@ br_scrubber_handle_freq (xlator_t *this, br_private_t *priv, dict_t *options)
cb8e9e
         return -1;
cb8e9e
 }
cb8e9e
 
cb8e9e
+static void br_scrubber_log_option (xlator_t *this,
cb8e9e
+                                    br_private_t *priv, gf_boolean_t scrubstall)
cb8e9e
+{
cb8e9e
+        struct br_scrubber *fsscrub = &priv->fsscrub;
cb8e9e
+        char *scrub_throttle_str[] = {
cb8e9e
+                [BR_SCRUB_THROTTLE_LAZY]       = "lazy",
cb8e9e
+                [BR_SCRUB_THROTTLE_NORMAL]     = "normal",
cb8e9e
+                [BR_SCRUB_THROTTLE_AGGRESSIVE] = "aggressive",
cb8e9e
+        };
cb8e9e
+
cb8e9e
+        char *scrub_freq_str[] = {
cb8e9e
+                [BR_FSSCRUB_FREQ_HOURLY]   = "hourly",
cb8e9e
+                [BR_FSSCRUB_FREQ_DAILY]    = "daily",
cb8e9e
+                [BR_FSSCRUB_FREQ_WEEKLY]   = "weekly",
cb8e9e
+                [BR_FSSCRUB_FREQ_BIWEEKLY] = "biweekly",
cb8e9e
+                [BR_FSSCRUB_FREQ_MONTHLY]  = "monthly (30 days)",
cb8e9e
+        };
cb8e9e
+
cb8e9e
+        if (scrubstall)
cb8e9e
+                return; /* logged as pause */
cb8e9e
+
cb8e9e
+        gf_log (this->name, GF_LOG_INFO, "SCRUB TUNABLES:: [Frequency: %s, "
cb8e9e
+                "Throttle: %s]", scrub_freq_str[fsscrub->frequency],
cb8e9e
+                scrub_throttle_str[fsscrub->throttle]);
cb8e9e
+}
cb8e9e
+
cb8e9e
 int32_t
cb8e9e
 br_scrubber_handle_options (xlator_t *this, br_private_t *priv, dict_t *options)
cb8e9e
 {
cb8e9e
@@ -1159,6 +1185,8 @@ br_scrubber_handle_options (xlator_t *this, br_private_t *priv, dict_t *options)
cb8e9e
         if (ret)
cb8e9e
                 goto error_return;
cb8e9e
 
cb8e9e
+        br_scrubber_log_option (this, priv, scrubstall);
cb8e9e
+
cb8e9e
         return 0;
cb8e9e
 
cb8e9e
  error_return:
cb8e9e
-- 
cb8e9e
1.7.1
cb8e9e