aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs/cifs_dfs_ref.c
diff options
context:
space:
mode:
authorIgor Mammedov <niallain@gmail.com>2008-04-24 04:56:07 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2008-04-25 09:15:26 -0400
commit78d31a3a87f84cf56004b7bc154831f2ee1186e8 (patch)
tree0b18911e95f08dc2bce01c1555fe65f1865b0c71 /fs/cifs/cifs_dfs_ref.c
parentb69d3987f4360a5e7e9e55465b3cdd0cc204b79e (diff)
cifs: timeout dfs automounts +little fix.
Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/cifs/cifs_dfs_ref.c')
-rw-r--r--fs/cifs/cifs_dfs_ref.c29
1 files changed, 21 insertions, 8 deletions
diff --git a/fs/cifs/cifs_dfs_ref.c b/fs/cifs/cifs_dfs_ref.c
index f53f41ff1665..95024c066d89 100644
--- a/fs/cifs/cifs_dfs_ref.c
+++ b/fs/cifs/cifs_dfs_ref.c
@@ -25,14 +25,26 @@
25 25
26static LIST_HEAD(cifs_dfs_automount_list); 26static LIST_HEAD(cifs_dfs_automount_list);
27 27
28/* 28static void cifs_dfs_expire_automounts(struct work_struct *work);
29 * DFS functions 29static DECLARE_DELAYED_WORK(cifs_dfs_automount_task,
30*/ 30 cifs_dfs_expire_automounts);
31static int cifs_dfs_mountpoint_expiry_timeout = 500 * HZ;
32
33static void cifs_dfs_expire_automounts(struct work_struct *work)
34{
35 struct list_head *list = &cifs_dfs_automount_list;
36
37 mark_mounts_for_expiry(list);
38 if (!list_empty(list))
39 schedule_delayed_work(&cifs_dfs_automount_task,
40 cifs_dfs_mountpoint_expiry_timeout);
41}
31 42
32void dfs_shrink_umount_helper(struct vfsmount *vfsmnt) 43void cifs_dfs_release_automount_timer(void)
33{ 44{
34 mark_mounts_for_expiry(&cifs_dfs_automount_list); 45 BUG_ON(!list_empty(&cifs_dfs_automount_list));
35 mark_mounts_for_expiry(&cifs_dfs_automount_list); 46 cancel_delayed_work(&cifs_dfs_automount_task);
47 flush_scheduled_work();
36} 48}
37 49
38/** 50/**
@@ -261,10 +273,11 @@ static int add_mount_helper(struct vfsmount *newmnt, struct nameidata *nd,
261 err = do_add_mount(newmnt, nd, nd->path.mnt->mnt_flags, mntlist); 273 err = do_add_mount(newmnt, nd, nd->path.mnt->mnt_flags, mntlist);
262 switch (err) { 274 switch (err) {
263 case 0: 275 case 0:
264 dput(nd->path.dentry); 276 path_put(&nd->path);
265 mntput(nd->path.mnt);
266 nd->path.mnt = newmnt; 277 nd->path.mnt = newmnt;
267 nd->path.dentry = dget(newmnt->mnt_root); 278 nd->path.dentry = dget(newmnt->mnt_root);
279 schedule_delayed_work(&cifs_dfs_automount_task,
280 cifs_dfs_mountpoint_expiry_timeout);
268 break; 281 break;
269 case -EBUSY: 282 case -EBUSY:
270 /* someone else made a mount here whilst we were busy */ 283 /* someone else made a mount here whilst we were busy */