]> git.proxmox.com Git - systemd.git/blame - src/basic/mount-util.h
New upstream version 239
[systemd.git] / src / basic / mount-util.h
CommitLineData
52ad194e 1/* SPDX-License-Identifier: LGPL-2.1+ */
60f067b4 2#pragma once
663996b3 3
db2df898
MP
4#include <fcntl.h>
5#include <mntent.h>
e3bff60a 6#include <stdbool.h>
4c89c718 7#include <stdio.h>
db2df898 8#include <sys/stat.h>
663996b3
MS
9#include <sys/types.h>
10
4c89c718 11#include "macro.h"
db2df898 12#include "missing.h"
663996b3 13
52ad194e
MB
14int name_to_handle_at_loop(int fd, const char *path, struct file_handle **ret_handle, int *ret_mnt_id, int flags);
15
16int path_get_mnt_id(const char *path, int *ret);
17
db2df898 18int fd_is_mount_point(int fd, const char *filename, int flags);
2897b343 19int path_is_mount_point(const char *path, const char *root, int flags);
f47781d8 20
db2df898
MP
21int repeat_unmount(const char *path, int flags);
22
23int umount_recursive(const char *target, int flags);
8a584da2 24int bind_remount_recursive(const char *prefix, bool ro, char **blacklist);
81c58355 25int bind_remount_recursive_with_mountinfo(const char *prefix, bool ro, char **blacklist, FILE *proc_self_mountinfo);
db2df898
MP
26
27int mount_move_root(const char *path);
28
29DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, endmntent);
30#define _cleanup_endmntent_ _cleanup_(endmntentp)
31
32bool fstype_is_network(const char *fstype);
f5e65279
MB
33bool fstype_is_api_vfs(const char *fstype);
34bool fstype_is_ro(const char *fsype);
35bool fstype_can_discard(const char *fstype);
52ad194e 36bool fstype_can_uid_gid(const char *fstype);
db2df898 37
5a920b42
MP
38const char* mode_to_inaccessible_node(mode_t mode);
39
8a584da2
MP
40int mount_verbose(
41 int error_log_level,
42 const char *what,
43 const char *where,
44 const char *type,
45 unsigned long flags,
46 const char *options);
47int umount_verbose(const char *where);
2897b343
MP
48
49const char *mount_propagation_flags_to_string(unsigned long flags);
50int mount_propagation_flags_from_string(const char *name, unsigned long *ret);
98393f85
MB
51
52int mount_option_mangle(
53 const char *options,
54 unsigned long mount_flags,
55 unsigned long *ret_mount_flags,
56 char **ret_remaining_options);