Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 27 06:55:24 UTC 2018

Modified Files:
        src/sys/external/bsd/common/include/linux: workqueue.h
        src/sys/external/bsd/common/linux: linux_work.c

Log Message:
Add system_long_wq.


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 \
    src/sys/external/bsd/common/include/linux/workqueue.h
cvs rdiff -u -r1.1 -r1.2 src/sys/external/bsd/common/linux/linux_work.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/external/bsd/common/include/linux/workqueue.h
diff -u src/sys/external/bsd/common/include/linux/workqueue.h:1.2 src/sys/external/bsd/common/include/linux/workqueue.h:1.3
--- src/sys/external/bsd/common/include/linux/workqueue.h:1.2	Mon Aug 27 06:54:40 2018
+++ src/sys/external/bsd/common/include/linux/workqueue.h	Mon Aug 27 06:55:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: workqueue.h,v 1.2 2018/08/27 06:54:40 riastradh Exp $	*/
+/*	$NetBSD: workqueue.h,v 1.3 2018/08/27 06:55:23 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -88,6 +88,7 @@ to_delayed_work(struct work_struct *work
 }
 
 extern struct workqueue_struct	*system_wq;
+extern struct workqueue_struct	*system_long_wq;
 
 int	linux_workqueue_init(void);
 void	linux_workqueue_fini(void);

Index: src/sys/external/bsd/common/linux/linux_work.c
diff -u src/sys/external/bsd/common/linux/linux_work.c:1.1 src/sys/external/bsd/common/linux/linux_work.c:1.2
--- src/sys/external/bsd/common/linux/linux_work.c:1.1	Wed Feb 24 22:04:15 2016
+++ src/sys/external/bsd/common/linux/linux_work.c	Mon Aug 27 06:55:23 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_work.c,v 1.1 2016/02/24 22:04:15 skrll Exp $	*/
+/*	$NetBSD: linux_work.c,v 1.2 2018/08/27 06:55:23 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.1 2016/02/24 22:04:15 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.2 2018/08/27 06:55:23 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -90,21 +90,35 @@ static void	linux_wait_for_delayed_cance
 static void	linux_worker_intr(void *);
 
 struct workqueue_struct		*system_wq;
+struct workqueue_struct		*system_long_wq;
 
 int
 linux_workqueue_init(void)
 {
+	int error;
 
 	system_wq = alloc_ordered_workqueue("lnxsyswq", 0);
 	if (system_wq == NULL)
-		return ENOMEM;
+		goto fail0;
+
+	system_long_wq = alloc_ordered_workqueue("lnxlngwq", 0);
+	if (system_long_wq == NULL)
+		goto fail1;
 
 	return 0;
+
+fail2: __unused
+	destroy_workqueue(system_long_wq);
+fail1:	destroy_workqueue(system_wq);
+fail0:	return ENOMEM;
 }
 
 void
 linux_workqueue_fini(void)
 {
+
+	destroy_workqueue(system_long_wq);
+	system_long_wq = NULL;
 	destroy_workqueue(system_wq);
 	system_wq = NULL;
 }

Reply via email to