summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaleb S. KEITHLEY <kkeithle@redhat.com>2018-10-01 14:09:03 -0400
committerShyamsundar Ranganathan <srangana@redhat.com>2018-10-04 14:41:17 +0000
commit4f7729748ee7d79e41dec9682a4fbbb2378ed5ac (patch)
treee4984fb0aa2e6ff95690d83bbba62ea24ebf9c70
parentdbafe63ea5602db3ad65a3e4fba15b6ee97776ce (diff)
dht: volume_options 'options' collision with nfs-ganesha's 'options'
When dht was converted to xlator_api, the variable 'options' was not changed to dht_options, the same as was done to all the other xlators that were converted to xlator_api. Thus the reference to 'options' in dht.c is not resolved until runtime, and the RTlinker's search path starts with symbols in the executable, i.e. ganesha.nfsd's 'options'. (Which is obviously not the right one.) The unused extern references to 'options' (now dht_options) in nufa.c and switch.c is curious. Change-Id: Idf4a5d5fbd39aadfa5a4b529bceea65a3cbdf8f3 updates: bz#1193929 Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>
-rw-r--r--xlators/cluster/dht/src/dht-shared.c9
-rw-r--r--xlators/cluster/dht/src/dht.c5
-rw-r--r--xlators/cluster/dht/src/nufa.c2
-rw-r--r--xlators/cluster/dht/src/switch.c2
4 files changed, 11 insertions, 7 deletions
diff --git a/xlators/cluster/dht/src/dht-shared.c b/xlators/cluster/dht/src/dht-shared.c
index afb5880b459..8cccbc86f0f 100644
--- a/xlators/cluster/dht/src/dht-shared.c
+++ b/xlators/cluster/dht/src/dht-shared.c
@@ -41,8 +41,6 @@
- handle all cases in self heal layout reconstruction
- complete linkfile selfheal
*/
-/* FIXME: Not sure why someone defined this here */
-/* struct volume_options options[]; */
extern dht_methods_t dht_methods;
@@ -908,7 +906,7 @@ err:
return -1;
}
-struct volume_options options[] = {
+struct volume_options dht_options[] = {
{
.key = {"lookup-unhashed"},
.value = {"auto", "yes", "no", "enable", "disable", "1", "0", "on",
@@ -1202,3 +1200,8 @@ struct volume_options options[] = {
{.key = {NULL}},
};
+
+#define NUM_DHT_OPTIONS (sizeof(dht_options) / sizeof(dht_options[0]))
+
+extern struct volume_options options[NUM_DHT_OPTIONS]
+ __attribute__((alias("dht_options")));
diff --git a/xlators/cluster/dht/src/dht.c b/xlators/cluster/dht/src/dht.c
index 6dfaa3b23ed..63ab926ca58 100644
--- a/xlators/cluster/dht/src/dht.c
+++ b/xlators/cluster/dht/src/dht.c
@@ -104,7 +104,8 @@ struct xlator_cbks cbks = {
extern int32_t
mem_acct_init(xlator_t *this);
-extern struct volume_options options[];
+
+extern struct volume_options dht_options[];
xlator_api_t xlator_api = {
.init = dht_init,
@@ -116,7 +117,7 @@ xlator_api_t xlator_api = {
.dumpops = &dumpops,
.fops = &fops,
.cbks = &cbks,
- .options = options,
+ .options = dht_options,
.identifier = "distribute",
.pass_through_fops = &dht_pt_fops,
.category = GF_MAINTAINED,
diff --git a/xlators/cluster/dht/src/nufa.c b/xlators/cluster/dht/src/nufa.c
index b8077f972d1..558611384fe 100644
--- a/xlators/cluster/dht/src/nufa.c
+++ b/xlators/cluster/dht/src/nufa.c
@@ -12,7 +12,7 @@
/* TODO: all 'TODO's in dht.c holds good */
-extern struct volume_options options[];
+extern struct volume_options dht_options[];
int
nufa_local_lookup_cbk(call_frame_t *frame, void *cookie, xlator_t *this,
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c
index ca9bfce5a8e..a3c384b0f5c 100644
--- a/xlators/cluster/dht/src/switch.c
+++ b/xlators/cluster/dht/src/switch.c
@@ -16,7 +16,7 @@
#include <fnmatch.h>
#include <string.h>
-extern struct volume_options options[];
+extern struct volume_options dht_options[];
struct switch_sched_array {
xlator_t *xl;