From 37414b3bca9cc73c6cddfc118d76a31fd763d64e Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Thu, 11 Jun 2015 20:19:39 +0530 Subject: features/bitrot: log scrub frequency & throttle values Backport of http://review.gluster.org/11190 Change-Id: I56d5236c37a413046b5766320184047a908f2c8d BUG: 1231024 Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/11397 Tested-by: Gluster Build System Tested-by: NetBSD Build System Reviewed-by: Vijay Bellur --- xlators/features/bit-rot/src/bitd/bit-rot-scrub.c | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'xlators/features') 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 26ad97a16e8..2da4530dbfb 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: -- cgit