summaryrefslogtreecommitdiffstats
path: root/xlators/cluster/dht/src/switch.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2018-12-06 16:24:52 +0530
committerAmar Tumballi <amarts@redhat.com>2018-12-13 14:41:50 +0530
commitaf7e957b4954bd84b8f7df6bfbd59c939092ead2 (patch)
treeadee47b6e02a44f5ba3f722d767dca929ccbd9c1 /xlators/cluster/dht/src/switch.c
parent088e2cbb5ee3f3e766b7e4021e2d86d0c5187de0 (diff)
xlator: make 'xlator_api' mandatory
* Remove the options to load old symbol. * keep only 'xlator_api' symbol from being exported using xlator.sym * add xlator_api to all the xlators where its missing NOTE: This covers all the xlators which has at least a test case to validate its loading. If there is a translator, which doesn't have any test, then we should probably remove that from codebase. fixes: #164 Change-Id: Ibcdc8c9844cda6b4463d907a15813745d14c1ebb Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'xlators/cluster/dht/src/switch.c')
-rw-r--r--xlators/cluster/dht/src/switch.c21
1 files changed, 16 insertions, 5 deletions
diff --git a/xlators/cluster/dht/src/switch.c b/xlators/cluster/dht/src/switch.c
index a3c384b0f5c..a782fcdfbd2 100644
--- a/xlators/cluster/dht/src/switch.c
+++ b/xlators/cluster/dht/src/switch.c
@@ -823,11 +823,6 @@ err:
return -1;
}
-class_methods_t class_methods = {.init = switch_init,
- .fini = switch_fini,
- .reconfigure = dht_reconfigure,
- .notify = dht_notify};
-
struct xlator_fops fops = {
.lookup = switch_lookup,
.create = switch_create,
@@ -869,3 +864,19 @@ struct xlator_fops fops = {
};
struct xlator_cbks cbks = {.forget = dht_forget};
+extern int32_t
+mem_acct_init(xlator_t *this);
+
+xlator_api_t xlator_api = {
+ .init = switch_init,
+ .fini = switch_fini,
+ .notify = dht_notify,
+ .reconfigure = dht_reconfigure,
+ .mem_acct_init = mem_acct_init,
+ .op_version = {1}, /* Present from the initial version */
+ .fops = &fops,
+ .cbks = &cbks,
+ .options = dht_options,
+ .identifier = "switch",
+ .category = GF_TECH_PREVIEW,
+};