From 96fc7f64da2ef09e82845a7ab97574f511a9aae5 Mon Sep 17 00:00:00 2001 From: N Balachandran Date: Thu, 3 Dec 2015 12:52:54 +0530 Subject: cluster/tier: fix loading tier.so into glusterd glusterd occasionally loads shared libraries of 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 BUG: 1287842 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 --- xlators/cluster/dht/src/dht-common.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) (limited to 'xlators/cluster/dht/src/dht-common.c') diff --git a/xlators/cluster/dht/src/dht-common.c b/xlators/cluster/dht/src/dht-common.c index 26bf7a01106..f9ea97f000a 100644 --- a/xlators/cluster/dht/src/dht-common.c +++ b/xlators/cluster/dht/src/dht-common.c @@ -3704,8 +3704,7 @@ dht_setxattr (call_frame_t *frame, xlator_t *this, conf = this->private; GF_VALIDATE_OR_GOTO (this->name, conf, err); - methods = conf->methods; - GF_VALIDATE_OR_GOTO (this->name, conf->methods, err); + methods = &(conf->methods); /* Rebalance daemon is allowed to set internal keys */ if (!conf->defrag) @@ -4591,8 +4590,7 @@ dht_readdirp_cbk (call_frame_t *frame, void *cookie, xlator_t *this, int op_ret, conf = this->private; GF_VALIDATE_OR_GOTO(this->name, conf, unwind); - methods = conf->methods; - GF_VALIDATE_OR_GOTO(this->name, conf->methods, done); + methods = &(conf->methods); if (op_ret < 0) goto done; @@ -4812,8 +4810,7 @@ dht_readdir_cbk (call_frame_t *frame, void *cookie, xlator_t *this, conf = this->private; GF_VALIDATE_OR_GOTO (this->name, conf, done); - methods = conf->methods; - GF_VALIDATE_OR_GOTO (this->name, conf->methods, done); + methods = &(conf->methods); if (op_ret < 0) goto done; @@ -5279,9 +5276,7 @@ dht_mknod_do (call_frame_t *frame) GF_VALIDATE_OR_GOTO (this->name, conf, err); - methods = conf->methods; - - GF_VALIDATE_OR_GOTO (this->name, conf->methods, err); + methods = &(conf->methods); /* We don't need parent_loc anymore */ loc_wipe (&local->loc); @@ -6229,9 +6224,7 @@ dht_create_do (call_frame_t *frame) GF_VALIDATE_OR_GOTO (this->name, conf, err); - methods = conf->methods; - - GF_VALIDATE_OR_GOTO (this->name, conf->methods, err); + methods = &(conf->methods); /* We don't need parent_loc anymore */ loc_wipe (&local->loc); @@ -7663,8 +7656,7 @@ dht_notify (xlator_t *this, int event, void *data, ...) conf = this->private; GF_VALIDATE_OR_GOTO (this->name, conf, out); - methods = conf->methods; - GF_VALIDATE_OR_GOTO (this->name, methods, out); + methods = &(conf->methods); /* had all subvolumes reported status once till now? */ had_heard_from_all = 1; -- cgit