2222 */
2323#define work_data_bits (work ) ((unsigned long *)(&(work)->data))
2424
25- enum {
25+ enum work_bits {
2626 WORK_STRUCT_PENDING_BIT = 0 , /* work item is pending execution */
2727 WORK_STRUCT_INACTIVE_BIT = 1 , /* work item is inactive */
2828 WORK_STRUCT_PWQ_BIT = 2 , /* data points to pwq */
@@ -36,21 +36,6 @@ enum {
3636
3737 WORK_STRUCT_COLOR_BITS = 4 ,
3838
39- WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT ,
40- WORK_STRUCT_INACTIVE = 1 << WORK_STRUCT_INACTIVE_BIT ,
41- WORK_STRUCT_PWQ = 1 << WORK_STRUCT_PWQ_BIT ,
42- WORK_STRUCT_LINKED = 1 << WORK_STRUCT_LINKED_BIT ,
43- #ifdef CONFIG_DEBUG_OBJECTS_WORK
44- WORK_STRUCT_STATIC = 1 << WORK_STRUCT_STATIC_BIT ,
45- #else
46- WORK_STRUCT_STATIC = 0 ,
47- #endif
48-
49- WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS ),
50-
51- /* not bound to any CPU, prefer the local CPU */
52- WORK_CPU_UNBOUND = NR_CPUS ,
53-
5439 /*
5540 * Reserve 8 bits off of pwq pointer w/ debugobjects turned off.
5641 * This makes pwqs aligned to 256 bytes and allows 16 workqueue
@@ -74,6 +59,26 @@ enum {
7459 WORK_OFFQ_LEFT = BITS_PER_LONG - WORK_OFFQ_POOL_SHIFT ,
7560 WORK_OFFQ_POOL_BITS = WORK_OFFQ_LEFT <= 31 ? WORK_OFFQ_LEFT : 31 ,
7661
62+ };
63+
64+ enum work_flags {
65+ WORK_STRUCT_PENDING = 1 << WORK_STRUCT_PENDING_BIT ,
66+ WORK_STRUCT_INACTIVE = 1 << WORK_STRUCT_INACTIVE_BIT ,
67+ WORK_STRUCT_PWQ = 1 << WORK_STRUCT_PWQ_BIT ,
68+ WORK_STRUCT_LINKED = 1 << WORK_STRUCT_LINKED_BIT ,
69+ #ifdef CONFIG_DEBUG_OBJECTS_WORK
70+ WORK_STRUCT_STATIC = 1 << WORK_STRUCT_STATIC_BIT ,
71+ #else
72+ WORK_STRUCT_STATIC = 0 ,
73+ #endif
74+ };
75+
76+ enum wq_misc_consts {
77+ WORK_NR_COLORS = (1 << WORK_STRUCT_COLOR_BITS ),
78+
79+ /* not bound to any CPU, prefer the local CPU */
80+ WORK_CPU_UNBOUND = NR_CPUS ,
81+
7782 /* bit mask for work_busy() return values */
7883 WORK_BUSY_PENDING = 1 << 0 ,
7984 WORK_BUSY_RUNNING = 1 << 1 ,
@@ -347,7 +352,7 @@ static inline unsigned int work_static(struct work_struct *work) { return 0; }
347352 * Workqueue flags and constants. For details, please refer to
348353 * Documentation/core-api/workqueue.rst.
349354 */
350- enum {
355+ enum wq_flags {
351356 WQ_UNBOUND = 1 << 1 , /* not bound to any cpu */
352357 WQ_FREEZABLE = 1 << 2 , /* freeze during suspend */
353358 WQ_MEM_RECLAIM = 1 << 3 , /* may be used for memory reclaim */
@@ -387,7 +392,9 @@ enum {
387392 __WQ_ORDERED = 1 << 17 , /* internal: workqueue is ordered */
388393 __WQ_LEGACY = 1 << 18 , /* internal: create*_workqueue() */
389394 __WQ_ORDERED_EXPLICIT = 1 << 19 , /* internal: alloc_ordered_workqueue() */
395+ };
390396
397+ enum wq_consts {
391398 WQ_MAX_ACTIVE = 512 , /* I like 512, better ideas? */
392399 WQ_UNBOUND_MAX_ACTIVE = WQ_MAX_ACTIVE ,
393400 WQ_DFL_ACTIVE = WQ_MAX_ACTIVE / 2 ,
0 commit comments