Module Name:    src
Committed By:   riastradh
Date:           Mon Aug 27 07:05:39 UTC 2018

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

Log Message:
Implement flush_delayed_work.


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 \
    src/sys/external/bsd/common/include/linux/workqueue.h
cvs rdiff -u -r1.4 -r1.5 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.5 src/sys/external/bsd/common/include/linux/workqueue.h:1.6
--- src/sys/external/bsd/common/include/linux/workqueue.h:1.5	Mon Aug 27 07:00:39 2018
+++ src/sys/external/bsd/common/include/linux/workqueue.h	Mon Aug 27 07:05:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: workqueue.h,v 1.5 2018/08/27 07:00:39 riastradh Exp $	*/
+/*	$NetBSD: workqueue.h,v 1.6 2018/08/27 07:05:39 riastradh Exp $	*/
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -48,6 +48,7 @@
 #define	cancel_work_sync		linux_cancel_work_sync
 #define	current_work			linux_current_work
 #define	destroy_workqueue		linux_destroy_workqueue
+#define	flush_delayed_work		linux_flush_delayed_work
 #define	flush_work			linux_flush_work
 #define	flush_workqueue			linux_flush_workqueue
 #define	queue_delayed_work		linux_queue_delayed_work
@@ -118,6 +119,7 @@ bool	mod_delayed_work(struct workqueue_s
 	    unsigned long ticks);
 bool	cancel_delayed_work(struct delayed_work *);
 bool	cancel_delayed_work_sync(struct delayed_work *);
+void	flush_delayed_work(struct delayed_work *);
 
 struct work_struct *
 	current_work(void);

Index: src/sys/external/bsd/common/linux/linux_work.c
diff -u src/sys/external/bsd/common/linux/linux_work.c:1.4 src/sys/external/bsd/common/linux/linux_work.c:1.5
--- src/sys/external/bsd/common/linux/linux_work.c:1.4	Mon Aug 27 07:00:39 2018
+++ src/sys/external/bsd/common/linux/linux_work.c	Mon Aug 27 07:05:39 2018
@@ -1,4 +1,4 @@
-/*	$NetBSD: linux_work.c,v 1.4 2018/08/27 07:00:39 riastradh Exp $	*/
+/*	$NetBSD: linux_work.c,v 1.5 2018/08/27 07:05:39 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.4 2018/08/27 07:00:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: linux_work.c,v 1.5 2018/08/27 07:05:39 riastradh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -889,6 +889,15 @@ cancel_delayed_work_sync(struct delayed_
 	return cancelled_p;
 }
 
+void
+flush_delayed_work(struct delayed_work *dw)
+{
+	struct workqueue_struct *wq = dw->work.w_wq;
+
+	if (wq != NULL)
+		flush_workqueue(wq);
+}
+
 static void
 linux_cancel_delayed_work_callout(struct delayed_work *dw, bool wait)
 {

Reply via email to