aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2010-01-24 00:28:52 -0500
committerAl Viro <viro@zeniv.linux.org.uk>2010-03-03 14:07:54 -0500
commit5b7e934d887c67fe093b61f1308bc2d9c49381ff (patch)
tree6498bae20c1e90cdee8d4d3bbef6658868843ad1 /fs
parent3899167dbd6832a3d8d7171b425257ad46b6c40c (diff)
Use kill_litter_super() in autofs4 ->kill_sb()
... and get rid of open-coding its guts (i.e. RIP autofs4_force_release()) Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/autofs4/inode.c62
1 files changed, 1 insertions, 61 deletions
diff --git a/fs/autofs4/inode.c b/fs/autofs4/inode.c
index 4670a7818eac..821b2b955dac 100644
--- a/fs/autofs4/inode.c
+++ b/fs/autofs4/inode.c
@@ -96,63 +96,6 @@ void autofs4_free_ino(struct autofs_info *ino)
96 kfree(ino); 96 kfree(ino);
97} 97}
98 98
99/*
100 * Deal with the infamous "Busy inodes after umount ..." message.
101 *
102 * Clean up the dentry tree. This happens with autofs if the user
103 * space program goes away due to a SIGKILL, SIGSEGV etc.
104 */
105static void autofs4_force_release(struct autofs_sb_info *sbi)
106{
107 struct dentry *this_parent = sbi->sb->s_root;
108 struct list_head *next;
109
110 if (!sbi->sb->s_root)
111 return;
112
113 spin_lock(&dcache_lock);
114repeat:
115 next = this_parent->d_subdirs.next;
116resume:
117 while (next != &this_parent->d_subdirs) {
118 struct dentry *dentry = list_entry(next, struct dentry, d_u.d_child);
119
120 /* Negative dentry - don`t care */
121 if (!simple_positive(dentry)) {
122 next = next->next;
123 continue;
124 }
125
126 if (!list_empty(&dentry->d_subdirs)) {
127 this_parent = dentry;
128 goto repeat;
129 }
130
131 next = next->next;
132 spin_unlock(&dcache_lock);
133
134 DPRINTK("dentry %p %.*s",
135 dentry, (int)dentry->d_name.len, dentry->d_name.name);
136
137 dput(dentry);
138 spin_lock(&dcache_lock);
139 }
140
141 if (this_parent != sbi->sb->s_root) {
142 struct dentry *dentry = this_parent;
143
144 next = this_parent->d_u.d_child.next;
145 this_parent = this_parent->d_parent;
146 spin_unlock(&dcache_lock);
147 DPRINTK("parent dentry %p %.*s",
148 dentry, (int)dentry->d_name.len, dentry->d_name.name);
149 dput(dentry);
150 spin_lock(&dcache_lock);
151 goto resume;
152 }
153 spin_unlock(&dcache_lock);
154}
155
156void autofs4_kill_sb(struct super_block *sb) 99void autofs4_kill_sb(struct super_block *sb)
157{ 100{
158 struct autofs_sb_info *sbi = autofs4_sbi(sb); 101 struct autofs_sb_info *sbi = autofs4_sbi(sb);
@@ -169,15 +112,12 @@ void autofs4_kill_sb(struct super_block *sb)
169 /* Free wait queues, close pipe */ 112 /* Free wait queues, close pipe */
170 autofs4_catatonic_mode(sbi); 113 autofs4_catatonic_mode(sbi);
171 114
172 /* Clean up and release dangling references */
173 autofs4_force_release(sbi);
174
175 sb->s_fs_info = NULL; 115 sb->s_fs_info = NULL;
176 kfree(sbi); 116 kfree(sbi);
177 117
178out_kill_sb: 118out_kill_sb:
179 DPRINTK("shutting down"); 119 DPRINTK("shutting down");
180 kill_anon_super(sb); 120 kill_litter_super(sb);
181} 121}
182 122
183static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt) 123static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt)