diff options
author | Kaushik BV <kaushikbv@gluster.com> | 2011-08-16 13:10:41 +0530 |
---|---|---|
committer | Anand Avati <avati@gluster.com> | 2011-08-18 22:42:48 -0700 |
commit | ce0aaba383b97dca52d11c18846a8154d529bf8a (patch) | |
tree | 494673947140ddded481e4532ce6c340eac09446 /xlators/performance/io-threads/src/io-threads.c | |
parent | b7596882b3ceba77bd812d2e5757d9fa3aa0fa17 (diff) |
mgmt/Glusterd: Implementation volume set help/help-xml
Change-Id: I0c54fd1c15550e5e5551e95ed32adb14d8029fab
Reviewed-on: http://review.gluster.com/238
Tested-by: Gluster Build System <jenkins@build.gluster.com>
Reviewed-by: Anand Avati <avati@gluster.com>
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.c')
-rw-r--r-- | xlators/performance/io-threads/src/io-threads.c | 34 |
1 files changed, 26 insertions, 8 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index 83a7d40aa90..a19a14f0f1c 100644 --- a/xlators/performance/io-threads/src/io-threads.c +++ b/xlators/performance/io-threads/src/io-threads.c @@ -36,7 +36,7 @@ void *iot_worker (void *arg); int iot_workers_scale (iot_conf_t *conf); int __iot_workers_scale (iot_conf_t *conf); - +struct volume_options options[]; call_stub_t * __iot_dequeue (iot_conf_t *conf) @@ -2157,11 +2157,12 @@ int init (xlator_t *this) { iot_conf_t *conf = NULL; - dict_t *options = this->options; + dict_t *xl_options = this->options; int thread_count = IOT_DEFAULT_THREADS; int idle_time = IOT_DEFAULT_IDLE; int ret = -1; int i = 0; + char *def_val = NULL; if (!this->children || this->children->next) { gf_log ("io-threads", GF_LOG_ERROR, @@ -2196,10 +2197,23 @@ init (xlator_t *this) set_stack_size (conf); - thread_count = IOT_DEFAULT_THREADS; + if (xlator_get_volopt_info (&this->volume_options, "thread-count", + &def_val, NULL)) { + gf_log (this->name, GF_LOG_ERROR, "Default value of " + "thread-count not found"); + ret = -1; + goto out; + } else { + if (gf_string2int32 (def_val, &conf->max_count)) { + gf_log (this->name, GF_LOG_ERROR, "Default value of " + "thread corrupt"); + ret = -1; + goto out; + } + } - if (dict_get (options, "thread-count")) { - thread_count = data_to_int32 (dict_get (options, + if (dict_get (xl_options, "thread-count")) { + thread_count = data_to_int32 (dict_get (xl_options, "thread-count")); if (thread_count < IOT_MIN_THREADS) { gf_log ("io-threads", GF_LOG_WARNING, @@ -2216,8 +2230,8 @@ init (xlator_t *this) } conf->max_count = thread_count; - if (dict_get (options, "idle-time")) { - idle_time = data_to_int32 (dict_get (options, + if (dict_get (xl_options, "idle-time")) { + idle_time = data_to_int32 (dict_get (xl_options, "idle-time")); if (idle_time < 0) idle_time = 1; @@ -2304,7 +2318,11 @@ struct volume_options options[] = { { .key = {"thread-count"}, .type = GF_OPTION_TYPE_INT, .min = IOT_MIN_THREADS, - .max = IOT_MAX_THREADS + .max = IOT_MAX_THREADS, + .default_value = "16", + .description = "Number of threads in IO threads translator which " + "perform concurrent IO operations" + }, {.key = {"idle-time"}, .type = GF_OPTION_TYPE_INT, |