From 554fa0c1315d0b4b78ba35a2d332d7ac0fd07d48 Mon Sep 17 00:00:00 2001 From: Gaurav Kumar Garg Date: Fri, 5 Jun 2015 13:58:28 +0530 Subject: features/bitrot: tuanble object signing waiting time value for bitrot Currently bitrot using 120 second waiting time for object to be signed after all fop's released. This signing waiting time value should be tunable. Command for changing the signing waiting time will be #gluster volume bitrot signing-time Change-Id: I89f3121564c1bbd0825f60aae6147413a2fbd798 BUG: 1228680 Signed-off-by: Gaurav Kumar Garg Signed-off-by: Venky Shankar Reviewed-on: http://review.gluster.org/11105 --- xlators/mgmt/glusterd/src/glusterd-volgen.c | 33 +++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c') diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 8fe1be16fad..e618e2c7a35 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -3737,6 +3737,33 @@ gd_get_matching_option (char **options, char *option) return *options; } +static int +bitrot_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme, + void *param) +{ + xlator_t *xl = NULL; + char *bitrot_option = NULL; + int ret = 0; + glusterd_volinfo_t *volinfo = NULL; + + volinfo = param; + + xl = first_of (graph); + + if (!strcmp (vme->option, "expiry-time")) { + ret = gf_asprintf (&bitrot_option, "expiry-time"); + if (ret != -1) { + ret = xlator_set_option (xl, bitrot_option, vme->value); + GF_FREE (bitrot_option); + } + + if (ret) + return -1; + } + + return ret; +} + static int scrubber_option_handler (volgen_graph_t *graph, struct volopt_map_entry *vme, void *param) @@ -4976,6 +5003,12 @@ build_bitd_volume_graph (volgen_graph_t *graph, goto out; } + ret = volgen_graph_set_options_generic (&cgraph, set_dict, + volinfo, + bitrot_option_handler); + if (ret) + goto out; + ret = volgen_graph_merge_sub (graph, &cgraph, clusters); if (ret) goto out; -- cgit