automount: move generically userful call repeat_mount() into mount-util.[ch]
This commit is contained in:
@@ -506,3 +506,24 @@ bool fstype_is_network(const char *fstype) {
|
||||
|
||||
return nulstr_contains(table, fstype);
|
||||
}
|
||||
|
||||
int repeat_unmount(const char *path, int flags) {
|
||||
bool done = false;
|
||||
|
||||
assert(path);
|
||||
|
||||
/* If there are multiple mounts on a mount point, this
|
||||
* removes them all */
|
||||
|
||||
for (;;) {
|
||||
if (umount2(path, flags) < 0) {
|
||||
|
||||
if (errno == EINVAL)
|
||||
return done;
|
||||
|
||||
return -errno;
|
||||
}
|
||||
|
||||
done = true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@
|
||||
int fd_is_mount_point(int fd, const char *filename, int flags);
|
||||
int path_is_mount_point(const char *path, int flags);
|
||||
|
||||
int repeat_unmount(const char *path, int flags);
|
||||
|
||||
int umount_recursive(const char *target, int flags);
|
||||
int bind_remount_recursive(const char *prefix, bool ro);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user