Skip to content

Commit

Permalink
Create 9P worker threads only if 9P is configured
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Malahal Naineni authored and ffilz committed Oct 5, 2018
1 parent 1b65dbb commit 6d342c3
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/MainNFSD/nfs_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6d342c3

Please sign in to comment.