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 /Documentation/slow-work.txt | |
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 'Documentation/slow-work.txt')
-rw-r--r-- | Documentation/slow-work.txt | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Documentation/slow-work.txt b/Documentation/slow-work.txt index ebc50f808ea4..f12fda31dcdc 100644 --- a/Documentation/slow-work.txt +++ b/Documentation/slow-work.txt | |||
@@ -64,9 +64,11 @@ USING SLOW WORK ITEMS | |||
64 | Firstly, a module or subsystem wanting to make use of slow work items must | 64 | Firstly, a module or subsystem wanting to make use of slow work items must |
65 | register its interest: | 65 | register its interest: |
66 | 66 | ||
67 | int ret = slow_work_register_user(); | 67 | int ret = slow_work_register_user(struct module *module); |
68 | 68 | ||
69 | This will return 0 if successful, or a -ve error upon failure. | 69 | This will return 0 if successful, or a -ve error upon failure. The module |
70 | pointer should be the module interested in using this facility (almost | ||
71 | certainly THIS_MODULE). | ||
70 | 72 | ||
71 | 73 | ||
72 | Slow work items may then be set up by: | 74 | Slow work items may then be set up by: |
@@ -110,7 +112,12 @@ operation. When all a module's slow work items have been processed, and the | |||
110 | module has no further interest in the facility, it should unregister its | 112 | module has no further interest in the facility, it should unregister its |
111 | interest: | 113 | interest: |
112 | 114 | ||
113 | slow_work_unregister_user(); | 115 | slow_work_unregister_user(struct module *module); |
116 | |||
117 | The module pointer is used to wait for all outstanding work items for that | ||
118 | module before completing the unregistration. This prevents the put_ref() code | ||
119 | from being taken away before it completes. module should almost certainly be | ||
120 | THIS_MODULE. | ||
114 | 121 | ||
115 | 122 | ||
116 | =============== | 123 | =============== |