summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c59
1 files changed, 50 insertions, 9 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index fe7c3405ed3..ac9a4def054 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -1164,6 +1164,7 @@ server_auth_option_handler (volgen_graph_t *graph,
char *aa = NULL;
int ret = 0;
char *key = NULL;
+ char *auth_path = NULL;
if (strcmp (vme->option, "!server-auth") != 0)
return 0;
@@ -1173,16 +1174,21 @@ server_auth_option_handler (volgen_graph_t *graph,
/* from 'auth.allow' -> 'allow', and 'auth.reject' -> 'reject' */
key = strchr (vme->key, '.') + 1;
- for (trav = xl->children; trav; trav = trav->next) {
- ret = gf_asprintf (&aa, "auth.addr.%s.%s", trav->xlator->name,
+ ret = xlator_get_option (xl, "auth-path", &auth_path);
+ if (ret) {
+ gf_msg ("glusterd", GF_LOG_ERROR, 0,
+ GD_MSG_DEFAULT_OPT_INFO,
+ "Failed to get auth-path from server graph");
+ return -1;
+ }
+ ret = gf_asprintf (&aa, "auth.addr.%s.%s", auth_path,
key);
- if (ret != -1) {
- ret = xlator_set_option (xl, aa, vme->value);
- GF_FREE (aa);
- }
- if (ret)
- return -1;
+ if (ret != -1) {
+ ret = xlator_set_option (xl, aa, vme->value);
+ GF_FREE (aa);
}
+ if (ret)
+ return -1;
return 0;
}
@@ -1523,6 +1529,27 @@ out:
}
static int
+brick_graph_add_decompounder (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
+ dict_t *set_dict, glusterd_brickinfo_t *brickinfo)
+{
+ xlator_t *xl = NULL;
+ xlator_t *this = NULL;
+ glusterd_conf_t *conf = NULL;
+ int ret = -1;
+
+ this = THIS;
+ GF_VALIDATE_OR_GOTO ("glusterd", this, out);
+ conf = this->private;
+ GF_VALIDATE_OR_GOTO (this->name, conf, out);
+
+ xl = volgen_graph_add (graph, "performance/decompounder", volinfo->volname);
+ if (xl)
+ ret = 0;
+out:
+ return ret;
+}
+
+static int
brick_graph_add_arbiter (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
dict_t *set_dict, glusterd_brickinfo_t *brickinfo)
{
@@ -2165,6 +2192,13 @@ brick_graph_add_server (volgen_graph_t *graph, glusterd_volinfo_t *volinfo,
return -1;
}
+ memset (key, 0, sizeof (key));
+ snprintf (key, sizeof (key), "auth-path");
+
+ ret = xlator_set_option (xl, key, brickinfo->path);
+ if (ret)
+ return -1;
+
if (dict_get_str (volinfo->dict, "auth.ssl-allow", &ssl_user) == 0) {
memset (key, 0, sizeof (key));
snprintf (key, sizeof (key), "auth.login.%s.ssl-allow",
@@ -2287,7 +2321,8 @@ out:
* the topology of the brick graph */
static volgen_brick_xlator_t server_graph_table[] = {
{brick_graph_add_server, NULL},
- {brick_graph_add_io_stats, NULL},
+ {brick_graph_add_decompounder, "decompounder"},
+ {brick_graph_add_io_stats, "NULL"},
{brick_graph_add_cdc, NULL},
{brick_graph_add_quota, "quota"},
{brick_graph_add_index, "index"},
@@ -5392,6 +5427,7 @@ glusterd_snapdsvc_generate_volfile (volgen_graph_t *graph,
char *loglevel = NULL;
char *xlator = NULL;
char *value = NULL;
+ char auth_path[] = "auth-path";
set_dict = dict_copy (volinfo->dict, NULL);
if (!set_dict)
@@ -5459,6 +5495,11 @@ glusterd_snapdsvc_generate_volfile (volgen_graph_t *graph,
if (ret)
return -1;
+ snprintf (key, sizeof (key), "snapd-%s", volinfo->volname);
+ ret = xlator_set_option (xl, auth_path, key);
+ if (ret)
+ return -1;
+
ret = volgen_graph_set_options_generic
(graph, set_dict,
(xlator && loglevel)? (void *)set_dict: volinfo,