From 35f96c039e8961e48af46af43b6ecf7a335feb15 Mon Sep 17 00:00:00 2001 From: Vikas Gorur Date: Thu, 17 Sep 2009 05:56:32 +0000 Subject: cluster/afr: Add new option "data-self-heal-algorithm" option: data-self-heal-algorithm type: string default: "full" This option allows the user to specify the algorithm to be used for data self-heal. Currently supported values are "full" and "diff". Signed-off-by: Anand V. Avati --- xlators/cluster/afr/src/afr.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'xlators/cluster/afr/src/afr.c') diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 6b7b007aeb8..5c2320715b6 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -2341,6 +2341,7 @@ init (xlator_t *this) char * read_subvol = NULL; char * fav_child = NULL; char * self_heal = NULL; + char * algo = NULL; char * change_log = NULL; int32_t lock_server_count = 1; @@ -2389,6 +2390,14 @@ init (xlator_t *this) } } + priv->data_self_heal_algorithm = "full"; + + dict_ret = dict_get_str (this->options, "data-self-heal-algorithm", + &algo); + if (dict_ret == 0) { + priv->data_self_heal_algorithm = strdup (algo); + } + dict_ret = dict_get_str (this->options, "metadata-self-heal", &self_heal); if (dict_ret == 0) { @@ -2662,6 +2671,9 @@ struct volume_options options[] = { { .key = {"data-self-heal"}, .type = GF_OPTION_TYPE_BOOL }, + { .key = {"data-self-heal-algorithm"}, + .type = GF_OPTION_TYPE_STR + }, { .key = {"metadata-self-heal"}, .type = GF_OPTION_TYPE_BOOL }, -- cgit