Commit 2374178
committed
pkg/cri/server: optimizations in unmountRecursive()
Use a PrefixFilter() to get only the mounts we're interested in,
which removes the need to manually filter mounts from the mountinfo
results.
Additional optimizations can be made, as:
> ... there's a little known fact that `umount(MNT_DETACH)` is actually
> recursive in Linux, IOW this function can be replaced with
> `unix.Umount(target, unix.MNT_DETACH)` (or `mount.UnmountAll(target, unix.MNT_DETACH)`
> (provided that target itself is a mount point).
e8fb2c3#r535450446
Signed-off-by: Sebastiaan van Stijn <[email protected]>1 parent 7572919 commit 2374178
1 file changed
Lines changed: 5 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
| 169 | + | |
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | 173 | | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | | - | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | | - | |
185 | 174 | | |
186 | 175 | | |
187 | | - | |
| 176 | + | |
188 | 177 | | |
189 | 178 | | |
190 | | - | |
191 | | - | |
| 179 | + | |
| 180 | + | |
192 | 181 | | |
193 | 182 | | |
194 | 183 | | |
195 | 184 | | |
196 | | - | |
| 185 | + | |
197 | 186 | | |
198 | 187 | | |
199 | 188 | | |
| |||
0 commit comments