summaryrefslogtreecommitdiffstats
path: root/xlators/features/changelog/src/changelog-rpc.c
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/features/changelog/src/changelog-rpc.c
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/features/changelog/src/changelog-rpc.c')
-rw-r--r--xlators/features/changelog/src/changelog-rpc.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/xlators/features/changelog/src/changelog-rpc.c b/xlators/features/changelog/src/changelog-rpc.c
index 28974fe0999..c29c8ea345a 100644
--- a/xlators/features/changelog/src/changelog-rpc.c
+++ b/xlators/features/changelog/src/changelog-rpc.c
@@ -69,9 +69,6 @@ changelog_init_rpc_threads(xlator_t *this, changelog_priv_t *priv, rbuf_t *rbuf,
int j = 0;
int ret = 0;
changelog_clnt_t *conn = NULL;
- char thread_name[GF_THREAD_NAMEMAX] = {
- 0,
- };
conn = &priv->connections;
@@ -111,9 +108,9 @@ changelog_init_rpc_threads(xlator_t *this, changelog_priv_t *priv, rbuf_t *rbuf,
/* spawn dispatcher threads */
for (; j < nr_dispatchers; j++) {
- snprintf(thread_name, sizeof(thread_name), "clogd%03hx", (j & 0x3ff));
ret = gf_thread_create(&priv->ev_dispatcher[j], NULL,
- changelog_ev_dispatch, conn, thread_name);
+ changelog_ev_dispatch, conn, "clogd%03hx",
+ j & 0x3ff);
if (ret != 0) {
changelog_cleanup_dispatchers(this, priv, j);
break;