diff options
author | Tejun Heo <tj@kernel.org> | 2011-01-14 10:56:37 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-01-14 12:25:11 -0500 |
commit | 0ad53eeefcbb2620b6a71ffdaad4add20b450b8b (patch) | |
tree | 6f24c2d7b0a7554842544e51bd8e52159086669e /fs/afs/server.c | |
parent | e1fcc7e2a719d139322fab3f47cfbd4340cf3d82 (diff) |
afs: add afs_wq and use it instead of the system workqueue
flush_scheduled_work() is going away. afs needs to make sure all the
works it has queued have finished before being unloaded and there can
be arbitrary number of pending works. Add afs_wq and use it as the
flush domain instead of the system workqueue.
Also, convert cancel_delayed_work() + flush_scheduled_work() to
cancel_delayed_work_sync() in afs_mntpt_kill_timer().
Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: linux-afs@lists.infradead.org
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/afs/server.c')
-rw-r--r-- | fs/afs/server.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/fs/afs/server.c b/fs/afs/server.c index 9fdc7fe3a7bc..d59b7516e943 100644 --- a/fs/afs/server.c +++ b/fs/afs/server.c | |||
@@ -238,8 +238,8 @@ void afs_put_server(struct afs_server *server) | |||
238 | if (atomic_read(&server->usage) == 0) { | 238 | if (atomic_read(&server->usage) == 0) { |
239 | list_move_tail(&server->grave, &afs_server_graveyard); | 239 | list_move_tail(&server->grave, &afs_server_graveyard); |
240 | server->time_of_death = get_seconds(); | 240 | server->time_of_death = get_seconds(); |
241 | schedule_delayed_work(&afs_server_reaper, | 241 | queue_delayed_work(afs_wq, &afs_server_reaper, |
242 | afs_server_timeout * HZ); | 242 | afs_server_timeout * HZ); |
243 | } | 243 | } |
244 | spin_unlock(&afs_server_graveyard_lock); | 244 | spin_unlock(&afs_server_graveyard_lock); |
245 | _leave(" [dead]"); | 245 | _leave(" [dead]"); |
@@ -285,10 +285,11 @@ static void afs_reap_server(struct work_struct *work) | |||
285 | expiry = server->time_of_death + afs_server_timeout; | 285 | expiry = server->time_of_death + afs_server_timeout; |
286 | if (expiry > now) { | 286 | if (expiry > now) { |
287 | delay = (expiry - now) * HZ; | 287 | delay = (expiry - now) * HZ; |
288 | if (!schedule_delayed_work(&afs_server_reaper, delay)) { | 288 | if (!queue_delayed_work(afs_wq, &afs_server_reaper, |
289 | delay)) { | ||
289 | cancel_delayed_work(&afs_server_reaper); | 290 | cancel_delayed_work(&afs_server_reaper); |
290 | schedule_delayed_work(&afs_server_reaper, | 291 | queue_delayed_work(afs_wq, &afs_server_reaper, |
291 | delay); | 292 | delay); |
292 | } | 293 | } |
293 | break; | 294 | break; |
294 | } | 295 | } |
@@ -323,5 +324,5 @@ void __exit afs_purge_servers(void) | |||
323 | { | 324 | { |
324 | afs_server_timeout = 0; | 325 | afs_server_timeout = 0; |
325 | cancel_delayed_work(&afs_server_reaper); | 326 | cancel_delayed_work(&afs_server_reaper); |
326 | schedule_delayed_work(&afs_server_reaper, 0); | 327 | queue_delayed_work(afs_wq, &afs_server_reaper, 0); |
327 | } | 328 | } |