summaryrefslogtreecommitdiffstats
path: root/xlators/performance
diff options
context:
space:
mode:
authorXavi Hernandez <xhernandez@redhat.com>2019-01-24 18:31:10 +0100
committerXavi Hernandez <xhernandez@redhat.com>2019-02-01 10:37:20 +0100
commit4674678951a1315975d66016fb55c49100b7819f (patch)
tree6572b7186f06c6405badc67cd1f3dbf450c4df6d /xlators/performance
parent6b98735956c599ea621fa560b201fb7de6c36cac (diff)
core: make gf_thread_create() easier to use
This patch creates a specific function to set the thread name using a string format and a variable argument list, like printf(). This function is used to set the thread name from gf_thread_create(), which now accepts a variable argument list to create the full name. It's not necessary anymore to use a local array to build the name of the thread. This is done automatically. Change-Id: Idd8d01fd462c227359b96e98699f8c6d962dc17c Updates: bz#1193929 Signed-off-by: Xavi Hernandez <xhernandez@redhat.com>
Diffstat (limited to 'xlators/performance')
-rw-r--r--xlators/performance/io-threads/src/io-threads.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c
index dbf8e8f..bf75015 100644
--- a/xlators/performance/io-threads/src/io-threads.c
+++ b/xlators/performance/io-threads/src/io-threads.c
@@ -813,9 +813,6 @@ __iot_workers_scale(iot_conf_t *conf)
pthread_t thread;
int ret = 0;
int i = 0;
- char thread_name[GF_THREAD_NAMEMAX] = {
- 0,
- };
for (i = 0; i < GF_FOP_PRI_MAX; i++)
scale += min(conf->queue_sizes[i], conf->ac_iot_limit[i]);
@@ -833,10 +830,8 @@ __iot_workers_scale(iot_conf_t *conf)
while (diff) {
diff--;
- snprintf(thread_name, sizeof(thread_name), "iotwr%03hx",
- (conf->curr_count & 0x3ff));
ret = gf_thread_create(&thread, &conf->w_attr, iot_worker, conf,
- thread_name);
+ "iotwr%03hx", conf->curr_count & 0x3ff);
if (ret == 0) {
conf->curr_count++;
gf_msg_debug(conf->this->name, 0,