summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src/glusterd-volgen.c
diff options
context:
space:
mode:
authorVarsha Rao <varao@redhat.com>2018-02-12 10:37:15 +0530
committerVarsha Rao <varshar16@review.gluster.org>2018-02-21 09:52:17 +0000
commitd0e7177416be3005b3f092addf0bba4dd9dc7a2d (patch)
tree34158ebb910b6de730f47dc2d903da7040809d47 /xlators/mgmt/glusterd/src/glusterd-volgen.c
parent49e57efa515f12013da9f5293846aff17ac48f7d (diff)
xlators/features/namespace: Add namespace xlator and link into brick graph
The following release-3.8-fb branch patch is upstreamed: > features/namespace: Add namespace xlator and link into brick graph > Commit ID: dbd30776f26e > https://review.gluster.org/#/c/18041/ > By Michael Goulet <mgoulet@fb.com> Changes in this patch: Removes extra config.h and namespace.h file in namespace.c Adds default_getspec_cbk to libglusterfs.sym Rename dict_for_each to dict_foreach_inline Remove fd.h header file stack.h Add test case for truncate, open and symlink This patch is required to forward port io-threads namespace patch. Updates: #401 Change-Id: Ib88c95b89eecee9b8957df8a4c8712c899c761d1 Signed-off-by: Varsha Rao <varao@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-volgen.c')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index 0c984c9..f9fcf88 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -2049,6 +2049,31 @@ out:
return ret;
}
+static int
+brick_graph_add_namespace (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
+ dict_t *set_dict, glusterd_brickinfo_t *brickinfo)
+{
+ xlator_t *xl = NULL;
+ int ret = -1;
+
+ if (!graph || !volinfo || !set_dict)
+ goto out;
+
+ ret = dict_get_str_boolean (set_dict, "features.tag-namespaces", 0);
+ if (ret == -1)
+ goto out;
+
+ if (ret) {
+ xl = volgen_graph_add (graph, "features/namespace", volinfo->volname);
+ if (!xl)
+ goto out;
+ }
+
+ ret = 0;
+out:
+ return ret;
+}
+
xlator_t *
add_one_peer (volgen_graph_t *graph, glusterd_brickinfo_t *peer,
char *volname, uint16_t index)
@@ -2642,6 +2667,7 @@ static volgen_brick_xlator_t server_graph_table[] = {
{brick_graph_add_decompounder, "decompounder"},
{brick_graph_add_io_stats, "NULL"},
{brick_graph_add_sdfs, "sdfs"},
+ {brick_graph_add_namespace, "namespace"},
{brick_graph_add_cdc, NULL},
{brick_graph_add_quota, "quota"},
{brick_graph_add_index, "index"},
@@ -4983,7 +5009,7 @@ static gf_boolean_t
volgen_is_shd_compatible_xl (char *xl_type)
{
char *shd_xls[] = {"cluster/replicate", "cluster/disperse",
- "debug/io-stats", NULL};
+ NULL};
if (gf_get_index_by_elem (shd_xls, xl_type) != -1)
return _gf_true;