From de6e9200cfbb91ee98abfb6c046c16805388631a Mon Sep 17 00:00:00 2001 From: Pranith Kumar Karampuri Date: Tue, 2 Feb 2016 06:37:11 -0800 Subject: Revert "glusterd/afr: store afr pending xattrs as a volume option" This reverts commit 486b07dfc33782d27e3458659cdd6090f496ad35. Change-Id: I2da12ef77fb01c52cae3c3b5547398b6a4d7d17e BUG: 1293536 Signed-off-by: Pranith Kumar Karampuri Reviewed-on: http://review.gluster.org/13339 Smoke: Gluster Build System CentOS-regression: Gluster Build System NetBSD-regression: NetBSD Build System --- xlators/cluster/afr/src/afr.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) (limited to 'xlators/cluster/afr/src') diff --git a/xlators/cluster/afr/src/afr.c b/xlators/cluster/afr/src/afr.c index 4c072b6c69f..5ef920a13d1 100644 --- a/xlators/cluster/afr/src/afr.c +++ b/xlators/cluster/afr/src/afr.c @@ -248,8 +248,6 @@ init (xlator_t *this) int read_subvol_index = -1; xlator_t *fav_child = NULL; char *qtype = NULL; - char *xattrs_list = NULL; - char *ptr = NULL; if (!this->children) { gf_msg (this->name, GF_LOG_ERROR, 0, @@ -403,7 +401,6 @@ init (xlator_t *this) goto out; } - GF_OPTION_INIT ("afr-pending-xattr", xattrs_list, str, out); priv->pending_key = GF_CALLOC (sizeof (*priv->pending_key), child_count, gf_afr_mt_char); @@ -411,25 +408,20 @@ init (xlator_t *this) ret = -ENOMEM; goto out; } - ptr = gf_strdup (xattrs_list); - if (!ptr) { - ret = -ENOMEM; - goto out; - } - for (i = 0, ptr = strtok (ptr, ","); ptr; ptr = strtok (NULL, ",")) { - ret = gf_asprintf (&priv->pending_key[i], "%s.%s", - AFR_XATTR_PREFIX, ptr); - if (ret == -1) { - ret = -ENOMEM; - goto out; - } - i++; - } trav = this->children; i = 0; while (i < child_count) { priv->children[i] = trav->xlator; + + ret = gf_asprintf (&priv->pending_key[i], "%s.%s", + AFR_XATTR_PREFIX, + trav->xlator->name); + if (-1 == ret) { + ret = -ENOMEM; + goto out; + } + trav = trav->next; i++; } @@ -465,7 +457,6 @@ init (xlator_t *this) ret = 0; out: - GF_FREE (ptr); return ret; } @@ -789,11 +780,6 @@ struct volume_options options[] = { .type = GF_OPTION_TYPE_STR, .default_value = AFR_DIRTY_DEFAULT, }, - { .key = {"afr-pending-xattr"}, - .type = GF_OPTION_TYPE_STR, - .description = "Comma seperated list of xattrs that are used to " - "capture information on pending heals." - }, { .key = {"metadata-splitbrain-forced-heal"}, .type = GF_OPTION_TYPE_BOOL, .default_value = "off", -- cgit