summaryrefslogtreecommitdiffstats
path: root/xlators/features/bit-rot
diff options
context:
space:
mode:
authorVenky Shankar <vshankar@redhat.com>2015-06-11 20:19:39 +0530
committerVijay Bellur <vbellur@redhat.com>2015-06-20 16:11:06 -0700
commita6e412c4fc6036b797226c1b9fa7b1b90856a7f0 (patch)
treefb130f356d1a9ab85f4f2a6acbc31576a2e7ecd5 /xlators/features/bit-rot
parentea1d2b0045e2c2ad82a2162a58f9fc36f9d07b20 (diff)
features/bitrot: log scrub frequency & throttle values
Change-Id: I56d5236c37a413046b5766320184047a908f2c8d BUG: 1231620 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/11190 Reviewed-by: Raghavendra Bhat <raghavendra@redhat.com> Tested-by: NetBSD Build System <jenkins@build.gluster.org> Reviewed-by: Vijay Bellur <vbellur@redhat.com>
Diffstat (limited to 'xlators/features/bit-rot')
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot-scrub.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
index b1be962a6e6..76d9e268f56 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
@@ -1136,6 +1136,32 @@ br_scrubber_handle_freq (xlator_t *this, br_private_t *priv, dict_t *options)
return -1;
}
+static void br_scrubber_log_option (xlator_t *this,
+ br_private_t *priv, gf_boolean_t scrubstall)
+{
+ struct br_scrubber *fsscrub = &priv->fsscrub;
+ char *scrub_throttle_str[] = {
+ [BR_SCRUB_THROTTLE_LAZY] = "lazy",
+ [BR_SCRUB_THROTTLE_NORMAL] = "normal",
+ [BR_SCRUB_THROTTLE_AGGRESSIVE] = "aggressive",
+ };
+
+ char *scrub_freq_str[] = {
+ [BR_FSSCRUB_FREQ_HOURLY] = "hourly",
+ [BR_FSSCRUB_FREQ_DAILY] = "daily",
+ [BR_FSSCRUB_FREQ_WEEKLY] = "weekly",
+ [BR_FSSCRUB_FREQ_BIWEEKLY] = "biweekly",
+ [BR_FSSCRUB_FREQ_MONTHLY] = "monthly (30 days)",
+ };
+
+ if (scrubstall)
+ return; /* logged as pause */
+
+ gf_log (this->name, GF_LOG_INFO, "SCRUB TUNABLES:: [Frequency: %s, "
+ "Throttle: %s]", scrub_freq_str[fsscrub->frequency],
+ scrub_throttle_str[fsscrub->throttle]);
+}
+
int32_t
br_scrubber_handle_options (xlator_t *this, br_private_t *priv, dict_t *options)
{
@@ -1154,6 +1180,8 @@ br_scrubber_handle_options (xlator_t *this, br_private_t *priv, dict_t *options)
if (ret)
goto error_return;
+ br_scrubber_log_option (this, priv, scrubstall);
+
return 0;
error_return: