summaryrefslogtreecommitdiffstats
path: root/xlators/performance/io-threads/src/io-threads.c
diff options
context:
space:
mode:
Diffstat (limited to 'xlators/performance/io-threads/src/io-threads.c')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index e31bd4bba20..0fe034a3f39 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -2079,10 +2079,51 @@ mem_acct_init (xlator_t *this)
return ret;
}
+
+
return ret;
}
int
+reconfigure ( xlator_t *this, dict_t *options)
+{
+ iot_conf_t *conf = NULL;
+ int ret = 0;
+ int thread_count;
+
+
+ if (dict_get (options, "thread-count")) {
+ thread_count = data_to_int32 (dict_get (options,
+ "thread-count"));
+
+ if (thread_count < IOT_MIN_THREADS) {
+ gf_log ("io-threads", GF_LOG_WARNING,
+ "Number of threads opted is less then min rest"
+ "oring it to previous value",conf->max_count);
+ ret = -1;
+ goto out;
+ }
+
+ if (thread_count > IOT_MAX_THREADS) {
+ gf_log ("io-threads", GF_LOG_WARNING,
+ "Number of threads opted is greater than max "
+ "restoring it to previous value",conf->max_count);
+ ret = -1;
+ goto out;
+ }
+
+ conf->max_count = thread_count;
+ }
+
+ ret = 0;
+
+out:
+ return ret;
+
+
+}
+
+int
init (xlator_t *this)
{
iot_conf_t *conf = NULL;