Lines Matching defs:mounts
23 * before continuing with other tasks. Without this hook the cleanup of mounts
86 * we're interested in. (There might also still be /dev/cgroup mounts).
93 /* Read mounts from 'self/mounts' relative to a directory filedescriptor.
95 * need to access /proc/self/mounts and the container's /proc doesn't contain
104 struct mount *mounts = (struct mount*)malloc(capacity * sizeof(*mounts));
106 if (!mounts) {
114 fd = openat(procfd, "self/mounts", O_RDONLY);
116 free(mounts);
125 free(mounts);
132 new = (struct mount*)realloc(mounts, capacity * sizeof(*mounts));
135 mounts = new;
137 new = &mounts[count++];
146 *mp = mounts;
154 free(mounts[count].src);
155 free(mounts[count].dst);
156 free(mounts[count].fs);
158 free(mounts);
165 struct mount *mounts;
189 /* Open a handle to /proc on the host as we need to access /proc/self/mounts
216 /* Now read [[procfd]]/self/mounts */
217 if (!read_mounts(procfd, &mounts, &count)) {
226 qsort(mounts, count, sizeof(*mounts), &mount_cmp_dst);
229 /* fprintf(stderr, "Unmount: %s\n", mounts[zi].dst); */
230 if (umount2(mounts[zi].dst, 0) != 0) {
232 if (mount_should_error(&mounts[zi])) {
234 argv[0], mounts[zi].dst, strerror(error));
237 mount_free(&mounts[zi]);
239 free(mounts);