From 0ef60a5c371359d2a5d0d8684a8a58f1f5801525 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Fri, 4 Dec 2015 10:34:37 +0530 Subject: cluster/tier: fix loading tier.so into glusterd The glusterd process loads the shared libraries of client translators. This failed for tiering due to a reference to dht_methods which is defined as a global variable which is not necessary. The global variable has been removed and this is now a member of dht_conf and is now initialised in the *_init calls. > Change-Id: Ifa0a21e3962b5cd8d9b927ef1d087d3b25312953 > Signed-off-by: N Balachandran > Reviewed-on: http://review.gluster.org/12863 > Tested-by: NetBSD Build System > Tested-by: Gluster Build System > Reviewed-by: Dan Lambright >Tested-by: Dan Lambright (cherry picked from commit 96fc7f64da2ef09e82845a7ab97574f511a9aae5) Change-Id: If3cc908ebfcd1f165504f15db2e3079d97f3132e BUG: 1288352 Signed-off-by: N Balachandran Reviewed-on: http://review.gluster.org/12877 Tested-by: NetBSD Build System Tested-by: Gluster Build System Reviewed-by: Dan Lambright Tested-by: Dan Lambright --- xlators/cluster/dht/src/dht-shared.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'xlators/cluster/dht/src/dht-shared.c') diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c index 75957d587e5..9d869e39f0e 100644 --- a/xlators/cluster/dht/src/dht-shared.c +++ b/xlators/cluster/dht/src/dht-shared.c @@ -569,6 +569,32 @@ out: return ret; } + + +int +dht_init_methods (xlator_t *this) +{ + int ret = -1; + dht_conf_t *conf = NULL; + dht_methods_t *methods = NULL; + + GF_VALIDATE_OR_GOTO ("dht", this, err); + + conf = this->private; + methods = &(conf->methods); + + methods->migration_get_dst_subvol = dht_migration_get_dst_subvol; + methods->migration_needed = dht_migration_needed; + methods->migration_other = NULL; + methods->layout_search = dht_layout_search; + + ret = 0; +err: + return ret; +} + + + int dht_init (xlator_t *this) { @@ -808,7 +834,8 @@ dht_init (xlator_t *this) if (dht_set_subvol_range(this)) goto err; - conf->methods = &dht_methods; + if (dht_init_methods (this)) + goto err; return 0; -- cgit