summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--cli/src/cli-cmd-parser.c2
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot-scrub.c7
-rw-r--r--xlators/features/bit-rot/src/bitd/bit-rot.h1
3 files changed, 9 insertions, 1 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 0adc956bfdc..7aed82c32f8 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -5161,7 +5161,7 @@ cli_cmd_bitrot_parse (const char **words, int wordcount, dict_t **options)
char *scrub_freq_values[] = {"hourly",
"daily", "weekly",
"biweekly", "monthly",
- NULL};
+ "minute", NULL};
char *scrub_values[] = {"pause", "resume",
"status", NULL};
dict_t *dict = NULL;
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 2f5729f1e6d..e76bfcb6f90 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
+++ b/xlators/features/bit-rot/src/bitd/bit-rot-scrub.c
@@ -840,6 +840,7 @@ br_fsscan_calculate_delta (uint32_t times)
return times;
}
+#define BR_SCRUB_MINUTE (60)
#define BR_SCRUB_HOURLY (60 * 60)
#define BR_SCRUB_DAILY (1 * 24 * 60 * 60)
#define BR_SCRUB_WEEKLY (7 * 24 * 60 * 60)
@@ -852,6 +853,9 @@ br_fsscan_calculate_timeout (scrub_freq_t freq)
uint32_t timo = 0;
switch (freq) {
+ case BR_FSSCRUB_FREQ_MINUTE:
+ timo = br_fsscan_calculate_delta (BR_SCRUB_MINUTE);
+ break;
case BR_FSSCRUB_FREQ_HOURLY:
timo = br_fsscan_calculate_delta (BR_SCRUB_HOURLY);
break;
@@ -1425,6 +1429,8 @@ br_scrubber_handle_freq (xlator_t *this, br_private_t *priv,
frequency = BR_FSSCRUB_FREQ_BIWEEKLY;
} else if (strcasecmp (tmp, "monthly") == 0) {
frequency = BR_FSSCRUB_FREQ_MONTHLY;
+ } else if (strcasecmp (tmp, "minute") == 0) {
+ frequency = BR_FSSCRUB_FREQ_MINUTE;
} else if (strcasecmp (tmp, BR_SCRUB_STALLED) == 0) {
frequency = BR_FSSCRUB_FREQ_STALLED;
} else
@@ -1457,6 +1463,7 @@ static void br_scrubber_log_option (xlator_t *this,
[BR_FSSCRUB_FREQ_WEEKLY] = "weekly",
[BR_FSSCRUB_FREQ_BIWEEKLY] = "biweekly",
[BR_FSSCRUB_FREQ_MONTHLY] = "monthly (30 days)",
+ [BR_FSSCRUB_FREQ_MINUTE] = "every minute",
};
if (scrubstall)
diff --git a/xlators/features/bit-rot/src/bitd/bit-rot.h b/xlators/features/bit-rot/src/bitd/bit-rot.h
index 835b9ca3bcc..656936956a2 100644
--- a/xlators/features/bit-rot/src/bitd/bit-rot.h
+++ b/xlators/features/bit-rot/src/bitd/bit-rot.h
@@ -55,6 +55,7 @@ typedef enum scrub_freq {
BR_FSSCRUB_FREQ_WEEKLY,
BR_FSSCRUB_FREQ_BIWEEKLY,
BR_FSSCRUB_FREQ_MONTHLY,
+ BR_FSSCRUB_FREQ_MINUTE,
BR_FSSCRUB_FREQ_STALLED,
} scrub_freq_t;