summaryrefslogtreecommitdiffstats
path: root/libglusterfs/src/xlator.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2017-09-18 23:03:32 +0530
committerAmar Tumballi <amarts@redhat.com>2017-11-03 14:40:52 +0530
commitbf5c5841c443a8da5b8f73c27b2ed83420f2303e (patch)
tree2006ede8204f8b27b46765840c08e395d79d05e9 /libglusterfs/src/xlator.c
parentcf62283467d7dd30b89b80717f1fbc24670cb44b (diff)
global options: add a sample option to handle
Fixes #303 Change-Id: Icdaa804711c43c65b9684f2649437aae1b5c1ed5 Signed-off-by: Amar Tumballi <amarts@redhat.com>
Diffstat (limited to 'libglusterfs/src/xlator.c')
-rw-r--r--libglusterfs/src/xlator.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/libglusterfs/src/xlator.c b/libglusterfs/src/xlator.c
index fdc2be144a6..4817da43da1 100644
--- a/libglusterfs/src/xlator.c
+++ b/libglusterfs/src/xlator.c
@@ -308,6 +308,8 @@ xlator_set_type (xlator_t *xl, const char *type)
/* Handle 'global' translator differently */
if (!strncmp (GF_GLOBAL_XLATOR_NAME, type,
strlen (GF_GLOBAL_XLATOR_NAME))) {
+ volume_opt_list_t *vol_opt = NULL;
+
/* set the required values from Global xlator */
xl->type = gf_strdup (GF_GLOBAL_XLATOR_NAME);
xl->cbks = global_xlator.cbks;
@@ -316,10 +318,21 @@ xlator_set_type (xlator_t *xl, const char *type)
xl->fini = global_xlator.fini;
xl->reconfigure = global_xlator.reconfigure;
+ vol_opt = GF_CALLOC (1, sizeof (volume_opt_list_t),
+ gf_common_mt_volume_opt_list_t);
+ if (!vol_opt) {
+ ret = -1;
+ goto out;
+ }
+
+ vol_opt->given_opt = global_xl_options;
+
INIT_LIST_HEAD (&xl->volume_options);
+ INIT_LIST_HEAD (&vol_opt->list);
+ list_add_tail (&vol_opt->list, &xl->volume_options);
fill_defaults(xl);
-
+ ret = 0;
goto out;
}