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/mntpt.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/mntpt.c')
-rw-r--r-- | fs/afs/mntpt.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/fs/afs/mntpt.c b/fs/afs/mntpt.c index 6153417caf57..e83c0336e7b5 100644 --- a/fs/afs/mntpt.c +++ b/fs/afs/mntpt.c | |||
@@ -268,8 +268,8 @@ static void *afs_mntpt_follow_link(struct dentry *dentry, struct nameidata *nd) | |||
268 | path_put(&nd->path); | 268 | path_put(&nd->path); |
269 | nd->path.mnt = newmnt; | 269 | nd->path.mnt = newmnt; |
270 | nd->path.dentry = dget(newmnt->mnt_root); | 270 | nd->path.dentry = dget(newmnt->mnt_root); |
271 | schedule_delayed_work(&afs_mntpt_expiry_timer, | 271 | queue_delayed_work(afs_wq, &afs_mntpt_expiry_timer, |
272 | afs_mntpt_expiry_timeout * HZ); | 272 | afs_mntpt_expiry_timeout * HZ); |
273 | break; | 273 | break; |
274 | case -EBUSY: | 274 | case -EBUSY: |
275 | /* someone else made a mount here whilst we were busy */ | 275 | /* someone else made a mount here whilst we were busy */ |
@@ -295,8 +295,8 @@ static void afs_mntpt_expiry_timed_out(struct work_struct *work) | |||
295 | 295 | ||
296 | if (!list_empty(&afs_vfsmounts)) { | 296 | if (!list_empty(&afs_vfsmounts)) { |
297 | mark_mounts_for_expiry(&afs_vfsmounts); | 297 | mark_mounts_for_expiry(&afs_vfsmounts); |
298 | schedule_delayed_work(&afs_mntpt_expiry_timer, | 298 | queue_delayed_work(afs_wq, &afs_mntpt_expiry_timer, |
299 | afs_mntpt_expiry_timeout * HZ); | 299 | afs_mntpt_expiry_timeout * HZ); |
300 | } | 300 | } |
301 | 301 | ||
302 | _leave(""); | 302 | _leave(""); |
@@ -310,6 +310,5 @@ void afs_mntpt_kill_timer(void) | |||
310 | _enter(""); | 310 | _enter(""); |
311 | 311 | ||
312 | ASSERT(list_empty(&afs_vfsmounts)); | 312 | ASSERT(list_empty(&afs_vfsmounts)); |
313 | cancel_delayed_work(&afs_mntpt_expiry_timer); | 313 | cancel_delayed_work_sync(&afs_mntpt_expiry_timer); |
314 | flush_scheduled_work(); | ||
315 | } | 314 | } |