diff options
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 28 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volume-set.c | 11 |
2 files changed, 38 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 0c984c97192..f9fcf88a256 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; diff --git a/xlators/mgmt/glusterd/src/glusterd-volume-set.c b/xlators/mgmt/glusterd/src/glusterd-volume-set.c index 5cfb1d0a9d3..243b6076868 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volume-set.c +++ b/xlators/mgmt/glusterd/src/glusterd-volume-set.c @@ -2368,6 +2368,17 @@ struct volopt_map_entry glusterd_volopt_map[] = { "snapdir-entry-path which is set by samba" }, + { .key = "features.tag-namespaces", + .voltype = "features/namespace", + .op_version = GD_OP_VERSION_4_1_0, + .option = "tag-namespaces", + .value = "off", + .flags = OPT_FLAG_CLIENT_OPT, + .description = "This option enables this translator's functionality " + "that tags every fop with a namespace hash for later " + "throttling, stats collection, logging, etc." + }, + #ifdef HAVE_LIB_Z /* Compressor-decompressor xlator options * defaults used from xlator/features/compress/src/cdc.h |