Commit 5b7e934d887c67fe093b61f1308bc2d9c49381ff
1 parent
3899167dbd
Exists in
master
and in
4 other branches
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>
Showing 1 changed file with 1 additions and 61 deletions Side-by-side Diff
fs/autofs4/inode.c
... | ... | @@ -96,63 +96,6 @@ |
96 | 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 | - */ | |
105 | -static 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); | |
114 | -repeat: | |
115 | - next = this_parent->d_subdirs.next; | |
116 | -resume: | |
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 | - | |
156 | 99 | void autofs4_kill_sb(struct super_block *sb) |
157 | 100 | { |
158 | 101 | struct autofs_sb_info *sbi = autofs4_sbi(sb); |
159 | 102 | |
... | ... | @@ -169,15 +112,12 @@ |
169 | 112 | /* Free wait queues, close pipe */ |
170 | 113 | autofs4_catatonic_mode(sbi); |
171 | 114 | |
172 | - /* Clean up and release dangling references */ | |
173 | - autofs4_force_release(sbi); | |
174 | - | |
175 | 115 | sb->s_fs_info = NULL; |
176 | 116 | kfree(sbi); |
177 | 117 | |
178 | 118 | out_kill_sb: |
179 | 119 | DPRINTK("shutting down"); |
180 | - kill_anon_super(sb); | |
120 | + kill_litter_super(sb); | |
181 | 121 | } |
182 | 122 | |
183 | 123 | static int autofs4_show_options(struct seq_file *m, struct vfsmount *mnt) |