summaryrefslogtreecommitdiffstats
path: root/xlators/mgmt/glusterd/src
diff options
context:
space:
mode:
authorJeff Darcy <jdarcy@redhat.com>2012-11-26 16:36:42 -0500
committerAnand Avati <avati@redhat.com>2012-12-04 14:42:14 -0800
commit86b01a278b55b19adefe9625e586252a5c75b474 (patch)
treeaf840bc92cf538884801f8e15b2b516452cc3d58 /xlators/mgmt/glusterd/src
parent48a1738467c2328a9f8d0fce09b64f286ef533e0 (diff)
dht: support auto-NUFA option
Many people have asked for behavior like the old NUFA, which builds and seems to run but was previously impossible to enable/configure in a standard way. This change allows NUFA to be enabled instead of DHT from the command line, with automatic selection of the local subvolume on each host. Change-Id: I0065938db3922361fd450a6c1919a4cbbf6f202e BUG: 882278 Signed-off-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-on: http://review.gluster.org/4234 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Anand Avati <avati@redhat.com>
Diffstat (limited to 'xlators/mgmt/glusterd/src')
-rw-r--r--xlators/mgmt/glusterd/src/glusterd-volgen.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c
index da1c2a4ef94..40b2e32a2b4 100644
--- a/xlators/mgmt/glusterd/src/glusterd-volgen.c
+++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c
@@ -108,6 +108,7 @@ static struct volopt_map_entry glusterd_volopt_map[] = {
{"cluster.rebalance-stats", "cluster/distribute", NULL, NULL, NO_DOC, 0, 2},
{"cluster.subvols-per-directory", "cluster/distribute", "directory-layout-spread", NULL, NO_DOC, 0, 2},
{"cluster.readdir-optimize", "cluster/distribute", NULL, NULL, NO_DOC, 0, 2},
+ {"cluster.nufa", "cluster/distribute", "!nufa", NULL, NO_DOC, 0, 2},
/* AFR xlator options */
{"cluster.entry-change-log", "cluster/replicate", NULL, NULL, NO_DOC, 0, 1},
@@ -2399,9 +2400,19 @@ volgen_graph_build_dht_cluster (volgen_graph_t *graph,
int ret = -1;
char *decommissioned_children = NULL;
xlator_t *dht = NULL;
+ char *optstr = NULL;
+ gf_boolean_t use_nufa = _gf_false;
+ if (dict_get_str(volinfo->dict,"cluster.nufa",&optstr) == 0) {
+ /* Keep static analyzers quiet by "using" the value. */
+ ret = gf_string2boolean(optstr,&use_nufa);
+ }
+
clusters = volgen_graph_build_clusters (graph, volinfo,
- "cluster/distribute", "%s-dht",
+ use_nufa
+ ? "cluster/nufa"
+ : "cluster/distribute",
+ "%s-dht",
child_count, child_count);
if (clusters < 0)
goto out;