summaryrefslogtreecommitdiffstats
path: root/xlators
diff options
context:
space:
mode:
authorKrishnan Parthasarathi <kparthas@redhat.com>2015-02-12 17:29:28 +0530
committerRaghavendra G <rgowdapp@redhat.com>2015-02-19 02:12:40 -0800
commitee9b0aab614b56aa8f3c8ed56ced88f769c0ee47 (patch)
tree476f33b2878e3922d2456a318d6c9abcecd1954c /xlators
parentf099a87fd36b600ccb8268937d3cd7ca84799f77 (diff)
client/server: fix reconfigure for event-threads option
Change-Id: Ica8bca13e4feb941e22651b642b848be165ccc9e BUG: 1104462 Signed-off-by: Krishnan Parthasarathi <kparthas@redhat.com> Reviewed-on: http://review.gluster.org/9648 Reviewed-by: Shyamsundar Ranganathan <srangana@redhat.com> Reviewed-by: Pranith Kumar Karampuri <pkarampu@redhat.com> Reviewed-by: Atin Mukherjee <amukherj@redhat.com> Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Raghavendra G <rgowdapp@redhat.com> Tested-by: Raghavendra G <rgowdapp@redhat.com>
Diffstat (limited to 'xlators')
-rw-r--r--xlators/protocol/client/src/client.c28
-rw-r--r--xlators/protocol/server/src/server.c28
2 files changed, 27 insertions, 29 deletions
diff --git a/xlators/protocol/client/src/client.c b/xlators/protocol/client/src/client.c
index 32952b49fbb..b919e4c80a5 100644
--- a/xlators/protocol/client/src/client.c
+++ b/xlators/protocol/client/src/client.c
@@ -2560,20 +2560,15 @@ out:
}
int
-client_check_event_threads (xlator_t *this, dict_t *options, clnt_conf_t *conf)
+client_check_event_threads (xlator_t *this, clnt_conf_t *conf, int32_t old,
+ int32_t new)
{
- int ret = -1;
- int eventthreads = 0;
-
- /* Read event-threads from the new configuration */
- ret = dict_get_int32 (options, "event-threads", &eventthreads);
- if (!ret) {
- conf->event_threads = eventthreads;
- }
- ret = event_reconfigure_threads (this->ctx->event_pool,
- conf->event_threads);
+ if (old == new)
+ return 0;
- return ret;
+ conf->event_threads = new;
+ return event_reconfigure_threads (this->ctx->event_pool,
+ conf->event_threads);
}
int
@@ -2586,6 +2581,7 @@ reconfigure (xlator_t *this, dict_t *options)
char *new_remote_subvol = NULL;
char *old_remote_host = NULL;
char *new_remote_host = NULL;
+ int32_t new_nthread = 0;
conf = this->private;
@@ -2595,7 +2591,10 @@ reconfigure (xlator_t *this, dict_t *options)
GF_OPTION_RECONF ("ping-timeout", conf->opt.ping_timeout,
options, int32, out);
- ret = client_check_event_threads (this, options, conf);
+ GF_OPTION_RECONF ("event-threads", new_nthread, options,
+ int32, out);
+ ret = client_check_event_threads (this, conf, conf->event_threads,
+ new_nthread);
if (ret)
goto out;
@@ -2679,7 +2678,8 @@ init (xlator_t *this)
/* Set event threads to the configured default */
GF_OPTION_INIT("event-threads", conf->event_threads, int32, out);
- ret = client_check_event_threads (this, this->options, conf);
+ ret = client_check_event_threads (this, conf, STARTING_EVENT_THREADS,
+ conf->event_threads);
if (ret)
goto out;
diff --git a/xlators/protocol/server/src/server.c b/xlators/protocol/server/src/server.c
index 97389116023..ac1feb96779 100644
--- a/xlators/protocol/server/src/server.c
+++ b/xlators/protocol/server/src/server.c
@@ -675,21 +675,15 @@ out:
}
int
-server_check_event_threads (xlator_t *this, dict_t *options,
- server_conf_t *conf)
+server_check_event_threads (xlator_t *this, server_conf_t *conf, int32_t old,
+ int32_t new)
{
- int ret = -1;
- int eventthreads = 0;
-
- /* Read event-threads from the new configuration */
- ret = dict_get_int32 (options, "event-threads", &eventthreads);
- if (!ret) {
- conf->event_threads = eventthreads;
- }
- ret = event_reconfigure_threads (this->ctx->event_pool,
- conf->event_threads);
+ if (old == new)
+ return 0;
- return ret;
+ conf->event_threads = new;
+ return event_reconfigure_threads (this->ctx->event_pool,
+ conf->event_threads);
}
int
@@ -705,6 +699,7 @@ reconfigure (xlator_t *this, dict_t *options)
int ret = 0;
char *statedump_path = NULL;
xlator_t *xl = NULL;
+ int32_t new_nthread = 0;
conf = this->private;
@@ -811,7 +806,9 @@ reconfigure (xlator_t *this, dict_t *options)
}
}
- ret = server_check_event_threads (this, options, conf);
+ GF_OPTION_RECONF ("event-threads", new_nthread, options, int32, out);
+ ret = server_check_event_threads (this, conf, conf->event_threads,
+ new_nthread);
if (ret)
goto out;
@@ -876,7 +873,8 @@ init (xlator_t *this)
/* Set event threads to the configured default */
GF_OPTION_INIT("event-threads", conf->event_threads, int32, out);
- ret = server_check_event_threads (this, this->options, conf);
+ ret = server_check_event_threads (this, conf, STARTING_EVENT_THREADS,
+ conf->event_threads);
if (ret)
goto out;