return remount_idmap_fd(p, userns_fd);
}
-typedef struct SubMount {
- char *path;
- int mount_fd;
-} SubMount;
-
static void sub_mount_clear(SubMount *s) {
assert(s);
s->mount_fd = safe_close(s->mount_fd);
}
-static void sub_mount_array_free(SubMount *s, size_t n) {
+void sub_mount_array_free(SubMount *s, size_t n) {
assert(s || n == 0);
for (size_t i = 0; i < n; i++)
}
}
-static int get_sub_mounts(
- const char *prefix,
- SubMount **ret_mounts,
- size_t *ret_n_mounts) {
+int get_sub_mounts(const char *prefix, SubMount **ret_mounts, size_t *ret_n_mounts) {
_cleanup_(mnt_free_tablep) struct libmnt_table *table = NULL;
_cleanup_(mnt_free_iterp) struct libmnt_iter *iter = NULL;
#include "macro.h"
#include "pidref.h"
+typedef struct SubMount {
+ char *path;
+ int mount_fd;
+} SubMount;
+
+void sub_mount_array_free(SubMount *s, size_t n);
+
+int get_sub_mounts(const char *prefix, SubMount **ret_mounts, size_t *ret_n_mounts);
+
int repeat_unmount(const char *path, int flags);
int umount_recursive_full(const char *target, int flags, char **keep);