From 6d342c30bb5c9f9d71a1c08e1194b0f28c169a55 Mon Sep 17 00:00:00 2001 From: Malahal Naineni Date: Thu, 4 Oct 2018 14:38:40 +0530 Subject: [PATCH] Create 9P worker threads only if 9P is configured Currently we create 9P socket and 9P dispatcher thread only if 9P protocol is configured. No need for worker threads without the dispatcher thread, so these are also created only if 9P protocol is configured. Change-Id: I585a645b79c580ef420a867244dab3be22c48148 Signed-off-by: Malahal Naineni --- src/MainNFSD/nfs_init.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/MainNFSD/nfs_init.c b/src/MainNFSD/nfs_init.c index 46ea9f8428..ab710308f2 100644 --- a/src/MainNFSD/nfs_init.c +++ b/src/MainNFSD/nfs_init.c @@ -531,14 +531,15 @@ static void nfs_Start_threads(void) LogDebug(COMPONENT_THREAD, "sigmgr thread started"); #ifdef _USE_9P - rc = _9p_worker_init(); - if (rc != 0) { - LogFatal(COMPONENT_THREAD, "Could not start worker threads: %d", - errno); - } - - /* Starting the 9P/TCP dispatcher thread */ if (nfs_param.core_param.core_options & CORE_OPTION_9P) { + /* Start 9P worker threads */ + rc = _9p_worker_init(); + if (rc != 0) { + LogFatal(COMPONENT_THREAD, + "Could not start worker threads: %d", errno); + } + + /* Starting the 9P/TCP dispatcher thread */ rc = pthread_create(&_9p_dispatcher_thrid, &attr_thr, _9p_dispatcher_thread, NULL); if (rc != 0) {