[Sheepdog] [PATCH v2 1/5] sheep: initialize workqueues just before event_loop()

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Wed Nov 2 10:59:22 CET 2011


This patch enables us to use signal in cluster drivers.

Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 sheep/sheep.c |   18 +++++++++---------
 1 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/sheep/sheep.c b/sheep/sheep.c
index 833a5cb..ad2e515 100644
--- a/sheep/sheep.c
+++ b/sheep/sheep.c
@@ -194,15 +194,6 @@ int main(int argc, char **argv)
 	if (ret)
 		exit(1);
 
-	sys->cpg_wqueue = init_work_queue(1);
-	sys->gateway_wqueue = init_work_queue(NR_GW_WORKER_THREAD);
-	sys->io_wqueue = init_work_queue(NR_IO_WORKER_THREAD);
-	sys->recovery_wqueue = init_work_queue(1);
-	sys->deletion_wqueue = init_work_queue(1);
-	if (!sys->cpg_wqueue || !sys->gateway_wqueue || !sys->io_wqueue ||
-	    !sys->recovery_wqueue || !sys->deletion_wqueue)
-		exit(1);
-
 	ret = create_listen_port(port, sys);
 	if (ret)
 		exit(1);
@@ -213,6 +204,15 @@ int main(int argc, char **argv)
 		exit(1);
 	}
 
+	sys->cpg_wqueue = init_work_queue(1);
+	sys->gateway_wqueue = init_work_queue(NR_GW_WORKER_THREAD);
+	sys->io_wqueue = init_work_queue(NR_IO_WORKER_THREAD);
+	sys->recovery_wqueue = init_work_queue(1);
+	sys->deletion_wqueue = init_work_queue(1);
+	if (!sys->cpg_wqueue || !sys->gateway_wqueue || !sys->io_wqueue ||
+	    !sys->recovery_wqueue || !sys->deletion_wqueue)
+		exit(1);
+
 	vprintf(SDOG_NOTICE, "Sheepdog daemon (version %s) started\n", PACKAGE_VERSION);
 
 	while (sys->status != SD_STATUS_SHUTDOWN || sys->nr_outstanding_reqs != 0)
-- 
1.7.2.5




More information about the sheepdog mailing list