diff options
author | David Howells <dhowells@redhat.com> | 2009-11-19 13:10:23 -0500 |
---|---|---|
committer | David Howells <dhowells@redhat.com> | 2009-11-19 13:10:23 -0500 |
commit | 3d7a641e544e428191667e8b1f83f96fa46dbd65 (patch) | |
tree | 172aa672eca96b94f5531885b82abb82b43c7d8a /include/linux/slow-work.h | |
parent | 66b00a7c93ec782d118d2c03bd599cfd041e80a1 (diff) |
SLOW_WORK: Wait for outstanding work items belonging to a module to clear
Wait for outstanding slow work items belonging to a module to clear when
unregistering that module as a user of the facility. This prevents the put_ref
code of a work item from being taken away before it returns.
Signed-off-by: David Howells <dhowells@redhat.com>
Diffstat (limited to 'include/linux/slow-work.h')
-rw-r--r-- | include/linux/slow-work.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/include/linux/slow-work.h b/include/linux/slow-work.h index b65c8881f07a..9adb2b30754f 100644 --- a/include/linux/slow-work.h +++ b/include/linux/slow-work.h | |||
@@ -24,6 +24,9 @@ struct slow_work; | |||
24 | * The operations used to support slow work items | 24 | * The operations used to support slow work items |
25 | */ | 25 | */ |
26 | struct slow_work_ops { | 26 | struct slow_work_ops { |
27 | /* owner */ | ||
28 | struct module *owner; | ||
29 | |||
27 | /* get a ref on a work item | 30 | /* get a ref on a work item |
28 | * - return 0 if successful, -ve if not | 31 | * - return 0 if successful, -ve if not |
29 | */ | 32 | */ |
@@ -42,6 +45,7 @@ struct slow_work_ops { | |||
42 | * queued | 45 | * queued |
43 | */ | 46 | */ |
44 | struct slow_work { | 47 | struct slow_work { |
48 | struct module *owner; /* the owning module */ | ||
45 | unsigned long flags; | 49 | unsigned long flags; |
46 | #define SLOW_WORK_PENDING 0 /* item pending (further) execution */ | 50 | #define SLOW_WORK_PENDING 0 /* item pending (further) execution */ |
47 | #define SLOW_WORK_EXECUTING 1 /* item currently executing */ | 51 | #define SLOW_WORK_EXECUTING 1 /* item currently executing */ |
@@ -84,8 +88,8 @@ static inline void vslow_work_init(struct slow_work *work, | |||
84 | } | 88 | } |
85 | 89 | ||
86 | extern int slow_work_enqueue(struct slow_work *work); | 90 | extern int slow_work_enqueue(struct slow_work *work); |
87 | extern int slow_work_register_user(void); | 91 | extern int slow_work_register_user(struct module *owner); |
88 | extern void slow_work_unregister_user(void); | 92 | extern void slow_work_unregister_user(struct module *owner); |
89 | 93 | ||
90 | #ifdef CONFIG_SYSCTL | 94 | #ifdef CONFIG_SYSCTL |
91 | extern ctl_table slow_work_sysctls[]; | 95 | extern ctl_table slow_work_sysctls[]; |