aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/workqueue.h
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2006-11-22 09:54:45 -0500
committerDavid Howells <dhowells@redhat.com>2006-11-22 09:54:45 -0500
commit6bb49e5965c1fc399b4d3cd2b5cf2da535b330c0 (patch)
treeebf48d3bb43c8dbf65d2653b8810973e69d3517e /include/linux/workqueue.h
parent52bad64d95bd89e08c49ec5a071fa6dcbe5a1a9c (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.h9
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
12struct workqueue_struct; 12struct workqueue_struct;
13 13
14typedef void (*work_func_t)(void *data);
15
14struct work_struct { 16struct 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));
91extern int FASTCALL(schedule_delayed_work(struct delayed_work *work, unsigned long delay)); 93extern int FASTCALL(schedule_delayed_work(struct delayed_work *work, unsigned long delay));
92 94
93extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, unsigned long delay); 95extern int schedule_delayed_work_on(int cpu, struct delayed_work *work, unsigned long delay);
94extern int schedule_on_each_cpu(void (*func)(void *info), void *info); 96extern int schedule_on_each_cpu(work_func_t func, void *info);
95extern void flush_scheduled_work(void); 97extern void flush_scheduled_work(void);
96extern int current_is_keventd(void); 98extern int current_is_keventd(void);
97extern int keventd_up(void); 99extern int keventd_up(void);
@@ -100,8 +102,7 @@ extern void init_workqueues(void);
100void cancel_rearming_delayed_work(struct delayed_work *work); 102void cancel_rearming_delayed_work(struct delayed_work *work);
101void cancel_rearming_delayed_workqueue(struct workqueue_struct *, 103void cancel_rearming_delayed_workqueue(struct workqueue_struct *,
102 struct delayed_work *); 104 struct delayed_work *);
103int execute_in_process_context(void (*fn)(void *), void *, 105int 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