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-26 20:44:22 -0700
commit37414b3bca9cc73c6cddfc118d76a31fd763d64e (patch)
tree6af86e6f093b2db6b1ba11d08fd47b324c1c074f /xlators/features/bit-rot
parent555a8a14d70676a3cbd0816d8d59c557c53bccd5 (diff)
features/bitrot: log scrub frequency & throttle values
Backport of http://review.gluster.org/11190 Change-Id: I56d5236c37a413046b5766320184047a908f2c8d BUG: 1231024 Signed-off-by: Venky Shankar <vshankar@redhat.com> Reviewed-on: http://review.gluster.org/11397 Tested-by: Gluster Build System <jenkins@build.gluster.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 26ad97a..2da4530 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
@@ -1141,6 +1141,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)
{
@@ -1159,6 +1185,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: