Skip to content

Commit b2fa844

Browse files
author
Kent Overstreet
committed
workqueue: Split out workqueue_types.h
More sched.h dependency culling - this lets us kill a rhashtable-types.h dependency on workqueue.h. Signed-off-by: Kent Overstreet <[email protected]>
1 parent dff0fd2 commit b2fa844

File tree

5 files changed

+29
-16
lines changed

5 files changed

+29
-16
lines changed

include/linux/dma-fence.h

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#include <linux/sched.h>
2222
#include <linux/printk.h>
2323
#include <linux/rcupdate.h>
24+
#include <linux/timekeeping.h>
2425

2526
struct dma_fence;
2627
struct dma_fence_ops;

include/linux/rhashtable-types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <linux/atomic.h>
1313
#include <linux/compiler.h>
1414
#include <linux/mutex.h>
15-
#include <linux/workqueue.h>
15+
#include <linux/workqueue_types.h>
1616

1717
struct rhash_head {
1818
struct rhash_head __rcu *next;

include/linux/timekeeping.h

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
#include <linux/errno.h>
66
#include <linux/clocksource_ids.h>
7+
#include <linux/ktime.h>
78

89
/* Included from linux/ktime.h */
910

include/linux/workqueue.h

+1-15
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,7 @@
1414
#include <linux/atomic.h>
1515
#include <linux/cpumask.h>
1616
#include <linux/rcupdate.h>
17-
18-
struct workqueue_struct;
19-
20-
struct work_struct;
21-
typedef void (*work_func_t)(struct work_struct *work);
22-
void delayed_work_timer_fn(struct timer_list *t);
17+
#include <linux/workqueue_types.h>
2318

2419
/*
2520
* The first word is the work queue pointer and the flags rolled into
@@ -95,15 +90,6 @@ enum {
9590
#define WORK_STRUCT_FLAG_MASK ((1ul << WORK_STRUCT_FLAG_BITS) - 1)
9691
#define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK)
9792

98-
struct work_struct {
99-
atomic_long_t data;
100-
struct list_head entry;
101-
work_func_t func;
102-
#ifdef CONFIG_LOCKDEP
103-
struct lockdep_map lockdep_map;
104-
#endif
105-
};
106-
10793
#define WORK_DATA_INIT() ATOMIC_LONG_INIT((unsigned long)WORK_STRUCT_NO_POOL)
10894
#define WORK_DATA_STATIC_INIT() \
10995
ATOMIC_LONG_INIT((unsigned long)(WORK_STRUCT_NO_POOL | WORK_STRUCT_STATIC))

include/linux/workqueue_types.h

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef _LINUX_WORKQUEUE_TYPES_H
3+
#define _LINUX_WORKQUEUE_TYPES_H
4+
5+
#include <linux/atomic.h>
6+
#include <linux/lockdep_types.h>
7+
#include <linux/timer_types.h>
8+
#include <linux/types.h>
9+
10+
struct workqueue_struct;
11+
12+
struct work_struct;
13+
typedef void (*work_func_t)(struct work_struct *work);
14+
void delayed_work_timer_fn(struct timer_list *t);
15+
16+
struct work_struct {
17+
atomic_long_t data;
18+
struct list_head entry;
19+
work_func_t func;
20+
#ifdef CONFIG_LOCKDEP
21+
struct lockdep_map lockdep_map;
22+
#endif
23+
};
24+
25+
#endif /* _LINUX_WORKQUEUE_TYPES_H */

0 commit comments

Comments
 (0)