From 4674678951a1315975d66016fb55c49100b7819f Mon Sep 17 00:00:00 2001 From: Xavi Hernandez Date: Thu, 24 Jan 2019 18:31:10 +0100 Subject: 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 --- xlators/performance/io-threads/src/io-threads.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'xlators/performance') diff --git a/xlators/performance/io-threads/src/io-threads.c b/xlators/performance/io-threads/src/io-threads.c index dbf8e8f6a70..bf75015eda8 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, -- cgit