diff options
author | Kaushik BV <kaushikbv@gluster.com> | 2010-10-07 06:37:12 +0000 |
---|---|---|
committer | Vijay Bellur <vijay@dev.gluster.com> | 2010-10-07 05:43:35 -0700 |
commit | c7b518ab85f6fbcbdbae64c8fa092e998a14d1e9 (patch) | |
tree | 4f55db97bf6e843c96637264c8d97219a5b0aa38 /xlators/mgmt/glusterd | |
parent | f62484f42230db9d240c9b0eaadac48d845053b1 (diff) |
mgmt/Glusterd: Volume set enhancements
- performance.flush-behind, transport.keepalive added
- volume info to display the options reconfigured
Signed-off-by: Kaushik BV <kaushikbv@gluster.com>
Signed-off-by: Vijay Bellur <vijay@dev.gluster.com>
BUG: 1159 ()
URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=1159
Diffstat (limited to 'xlators/mgmt/glusterd')
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-handler.c | 37 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-op-sm.c | 8 | ||||
-rw-r--r-- | xlators/mgmt/glusterd/src/glusterd-volgen.c | 3 |
3 files changed, 44 insertions, 4 deletions
diff --git a/xlators/mgmt/glusterd/src/glusterd-handler.c b/xlators/mgmt/glusterd/src/glusterd-handler.c index 448dd65348d..57239c6266d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-handler.c +++ b/xlators/mgmt/glusterd/src/glusterd-handler.c @@ -254,6 +254,7 @@ out: return ret; } + int glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo, dict_t *volumes, int count) @@ -264,6 +265,11 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo, glusterd_brickinfo_t *brickinfo = NULL; char *buf = NULL; int i = 1; + data_pair_t *pairs = NULL; + char reconfig_key[256] = {0, }; + dict_t *dict = NULL; + data_t *value = NULL; + GF_ASSERT (volinfo); GF_ASSERT (volumes); @@ -309,6 +315,37 @@ glusterd_add_volume_detail_to_dict (glusterd_volinfo_t *volinfo, goto out; i++; } + + dict = volinfo->dict; + if (!dict) { + ret = -1; + goto out; + } + + pairs = dict->members_list; + if (!pairs) { + ret = -1; + goto out; + } + + while (pairs) { + if (1 == glusterd_check_option_exists (pairs->key, NULL)) { + value = pairs->value; + if (!value) { + ret = -1; + goto out; + } + snprintf (reconfig_key, 256, "volume%d.option.%s", count, + pairs->key); + gf_log ("", GF_LOG_DEBUG, + "Setting dict with key=%s, value=%s", + reconfig_key, pairs->value->data); + ret = dict_set_str (volumes, gf_strdup (reconfig_key), + value->data); + } + pairs = pairs->next; + } + out: return ret; } diff --git a/xlators/mgmt/glusterd/src/glusterd-op-sm.c b/xlators/mgmt/glusterd/src/glusterd-op-sm.c index d867497ccf9..4ae7afcc39d 100644 --- a/xlators/mgmt/glusterd/src/glusterd-op-sm.c +++ b/xlators/mgmt/glusterd/src/glusterd-op-sm.c @@ -1087,10 +1087,10 @@ out: static int glusterd_op_stage_set_volume (gd1_mgmt_stage_op_req *req, char **op_errstr) { - int ret = 0; - dict_t *dict = NULL; - char *volname = NULL; - gf_boolean_t exists = _gf_false; + int ret = 0; + dict_t *dict = NULL; + char *volname = NULL; + int exists = 0; char *key = NULL; char *value = NULL; char str[100] = {0, }; diff --git a/xlators/mgmt/glusterd/src/glusterd-volgen.c b/xlators/mgmt/glusterd/src/glusterd-volgen.c index 9d3ceaf5659..cfd7a7396a9 100644 --- a/xlators/mgmt/glusterd/src/glusterd-volgen.c +++ b/xlators/mgmt/glusterd/src/glusterd-volgen.c @@ -110,6 +110,7 @@ static struct volopt_map_entry glusterd_volopt_map[] = { {"performance.cache-priority", "performance/io-cache", "priority",}, /* NODOC */ {"performance.cache-size", "performance/io-cache", }, {"performance.cache-size", "performance/quick-read", }, + {"performance.flush-behind", "performance/write-behind", "flush-behind",}, {"performance.io-thread-count", "performance/io-threads", "thread-count",}, @@ -124,6 +125,8 @@ static struct volopt_map_entry glusterd_volopt_map[] = { {"auth.allow", "protocol/server", "!server-auth", "*"}, {"auth.reject", "protocol/server", "!server-auth",}, + + {"transport.keepalive", "protocol/server", "transport.socket.keepalive",}, {"performance.write-behind", "performance/write-behind", "!perf", "on"}, /* NODOC */ {"performance.read-ahead", "performance/read-ahead", "!perf", "on"}, /* NODOC */ |