From cf62283467d7dd30b89b80717f1fbc24670cb44b Mon Sep 17 00:00:00 2001 From: Amar Tumballi Date: Tue, 12 Sep 2017 22:07:10 +0530 Subject: Add framework for global xlator in graph Updates #303 Change-Id: Id0b9050c93ea87532dc80b4fda650c5663d285bd Signed-off-by: Amar Tumballi --- libglusterfs/src/globals.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'libglusterfs/src/globals.c') diff --git a/libglusterfs/src/globals.c b/libglusterfs/src/globals.c index 0ac1ab9b65b..a43b80aa060 100644 --- a/libglusterfs/src/globals.c +++ b/libglusterfs/src/globals.c @@ -137,6 +137,29 @@ static struct xlator_cbks global_cbks = { .fdctxsize = NULL, }; +/* This is required to get through the check in graph.c */ +static struct xlator_fops global_fops = { +}; + +static int +global_xl_reconfigure (xlator_t *this, dict_t *options) +{ + dict_dump_to_log (options); + return 0; +} + +static int +global_xl_init (xlator_t *this) +{ + return 0; +} + +static void +global_xl_fini (xlator_t *this) +{ + return; +} + int glusterfs_this_init () { @@ -151,8 +174,12 @@ glusterfs_this_init () } global_xlator.name = "glusterfs"; - global_xlator.type = "global"; + global_xlator.type = GF_GLOBAL_XLATOR_NAME; global_xlator.cbks = &global_cbks; + global_xlator.fops = &global_fops; + global_xlator.reconfigure = global_xl_reconfigure; + global_xlator.init = global_xl_init; + global_xlator.fini = global_xl_fini; INIT_LIST_HEAD (&global_xlator.volume_options); -- cgit