diff options
author | Csaba Henk <csaba@gluster.com> | 2010-10-02 07:30:39 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-02 06:30:23 -0700 |
commit | ef44323b4ba58fa8c1eb89105851983f828dd91b (patch) | |
tree | dcbfd98a87e1987145ab97366527b4e6e8900902 /xlators/mgmt/glusterd/src/glusterd-op-sm.c | |
parent | 067d0e476abe42f1e290039cb903928080e90d8d (diff) |
volgen: reimplement volgen
Generating a volfile occurs in two steps:
- Build a graph (ie, glusterfs_graph_t instance) by graph manipulation
primitives
- Write out the graph to a file by the the graph printing API.
Graph builder routines can optionally make use of a "modifier dict",
which can contain overrides wrt. volume options. This can be used
for a "dry-run" graph generation.
Signed-off-by: Csaba Henk <csaba@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1750 (clean up volgen)
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1750
Diffstat (limited to 'xlators/mgmt/glusterd/src/glusterd-op-sm.c')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 52 |
1 files changed, 11 insertions, 41 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index 98ca78b5f62..317eab700ba 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1119,50 +1119,16 @@ out: } -char *set_option_list[] = { - "max-file-size", - "min-file-size", - "cache-timeout", - "priority", - "entry-change-log", - "read-subvolume", - "background-self-heal-count", - "metadata-self-heal", - "data-self-heal", - "entry-self-heal", - "strict-readdir", - "data-self-heal-window-size", - "data-change-log", - "metadata-change-log", - "frame-timeout", - "ping-timeout", - "cache-size", - "disk-usage-limit", - "min-free-disk-limit", - "block-size", - "inode-lru-limit", - "thread-count" , - "lookup-unhashed", - "min-free-disk", - "write-behind", - "read-ahead", - "io-cache", - "quick-read", - "stat-prefetch", - "latency-measurement", - "dump-fd-stats", -}; - - gf_boolean_t glusterd_check_option_exists(char *optstring) { - //struct set_option_list *list; - char **list = NULL; + struct volopt_map_entry *vme = NULL; - for (list = &set_option_list[0]; *list ;list++) - if (!strcmp (optstring, *list)) + for (vme = glusterd_volopt_map; vme->key; vme++) { + if (strcmp (vme->key, optstring) == 0) return _gf_true; + } + return _gf_false; } @@ -1781,7 +1747,7 @@ rb_regenerate_volfiles (glusterd_volinfo_t *volinfo, goto out; } - ret = glusterd_rb_create_volfiles (volinfo, brickinfo); + ret = glusterd_create_rb_volfiles (volinfo, brickinfo); out: return ret; @@ -2844,7 +2810,11 @@ glusterd_op_set_volume (gd1_mgmt_stage_op_req *req) goto out; } - ret = set_xlator_option (volinfo->dict, key, value); + value = gf_strdup (value); + if (value) + ret = dict_set_dynstr (volinfo->dict, key, value); + else + ret = -1; if (ret) { gf_log ("", GF_LOG_ERROR, "Unable to set the options" |