diff options
author | David Howells <dhowells@redhat.com> | 2006-11-22 09:54:45 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2006-11-22 09:54:45 -0500 |
commit | 6bb49e5965c1fc399b4d3cd2b5cf2da535b330c0 (patch) | |
tree | ebf48d3bb43c8dbf65d2653b8810973e69d3517e /include/linux/workqueue.h | |
parent | 52bad64d95bd89e08c49ec5a071fa6dcbe5a1a9c (diff) |
WorkStruct: Typedef the work function prototype
Define a type for the work function prototype. It's not only kept in the
work_struct struct, it's also passed as an argument to several functions.
This makes it easier to change it.
Signed-Off-By: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux/workqueue.h')
-rw-r--r-- | include/linux/workqueue.h | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 9faaccae570e..cef40b22ff9a 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -11,10 +11,12 @@ | |||
11 | 11 | ||
12 | struct workqueue_struct; | 12 | struct workqueue_struct; |
13 | 13 | ||
14 | typedef void (*work_func_t)(void *data); | ||
15 | |||
14 | struct work_struct { | 16 | struct work_struct { |
15 | unsigned long pending; | 17 | unsigned long pending; |
16 | struct list_head entry; | 18 | struct list_head entry; |
17 | void (*func)(void *); | 19 | work_func_t func; |
18 | void *data; | 20 | void *data; |
19 | void *wq_data; | 21 | void *wq_data; |
20 | }; | 22 | }; |
@@ -91,7 +93,7 @@ extern int FASTCALL(schedule_work(struct work_struct *work)); | |||
91 | extern int FASTCALL(schedule_delayed_work(struct delayed_work *work, unsigned long delay)); | 93 | extern int FASTCALL(schedule_delayed_work(struct delayed_work *work, unsigned long delay)); |
92 | 94 | ||
93 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, unsigned long delay); | 95 | extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, unsigned long delay); |
94 | extern int schedule_on_each_cpu(void (*func)(void *info), void *info); | 96 | extern int schedule_on_each_cpu(work_func_t func, void *info); |
95 | extern void flush_scheduled_work(void); | 97 | extern void flush_scheduled_work(void); |
96 | extern int current_is_keventd(void); | 98 | extern int current_is_keventd(void); |
97 | extern int keventd_up(void); | 99 | extern int keventd_up(void); |
@@ -100,8 +102,7 @@ extern void init_workqueues(void); | |||
100 | void cancel_rearming_delayed_work(struct delayed_work *work); | 102 | void cancel_rearming_delayed_work(struct delayed_work *work); |
101 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, | 103 | void cancel_rearming_delayed_workqueue(struct workqueue_struct *, |
102 | struct delayed_work *); | 104 | struct delayed_work *); |
103 | int execute_in_process_context(void (*fn)(void *), void *, | 105 | int execute_in_process_context(work_func_t fn, void *, struct execute_work *); |
104 | struct execute_work *); | ||
105 | 106 | ||
106 | /* | 107 | /* |
107 | * Kill off a pending schedule_delayed_work(). Note that the work callback | 108 | * Kill off a pending schedule_delayed_work(). Note that the work callback |