chiark / gitweb /
37ec09f032c97cf9707f351795eef606b047cb86
[elogind.git] / src / basic / mount-util.h
1 /* SPDX-License-Identifier: LGPL-2.1+ */
2 #pragma once
3
4 /***
5   Copyright 2010 Lennart Poettering
6 ***/
7
8 #include <fcntl.h>
9 #include <mntent.h>
10 #include <stdbool.h>
11 #include <stdio.h>
12 #include <sys/stat.h>
13 #include <sys/types.h>
14
15 #include "macro.h"
16 #include "missing.h"
17
18 int name_to_handle_at_loop(int fd, const char *path, struct file_handle **ret_handle, int *ret_mnt_id, int flags);
19
20 int path_get_mnt_id(const char *path, int *ret);
21
22 int fd_is_mount_point(int fd, const char *filename, int flags);
23 int path_is_mount_point(const char *path, const char *root, int flags);
24
25 #if 0 /// UNNEEDED by elogind
26 int repeat_unmount(const char *path, int flags);
27
28 int umount_recursive(const char *target, int flags);
29 int bind_remount_recursive(const char *prefix, bool ro, char **blacklist);
30 int bind_remount_recursive_with_mountinfo(const char *prefix, bool ro, char **blacklist, FILE *proc_self_mountinfo);
31
32 int mount_move_root(const char *path);
33 #endif // 0
34
35 DEFINE_TRIVIAL_CLEANUP_FUNC(FILE*, endmntent);
36 #define _cleanup_endmntent_ _cleanup_(endmntentp)
37
38 #if 0 /// UNNEEDED by elogind
39 bool fstype_is_network(const char *fstype);
40 #endif // 0
41 bool fstype_is_api_vfs(const char *fstype);
42 bool fstype_is_ro(const char *fsype);
43 bool fstype_can_discard(const char *fstype);
44 bool fstype_can_uid_gid(const char *fstype);
45
46 const char* mode_to_inaccessible_node(mode_t mode);
47
48 #if 0 /// UNNEEDED by elogind
49 int mount_verbose(
50                 int error_log_level,
51                 const char *what,
52                 const char *where,
53                 const char *type,
54                 unsigned long flags,
55                 const char *options);
56 int umount_verbose(const char *where);
57 #endif // 0
58
59 const char *mount_propagation_flags_to_string(unsigned long flags);
60 int mount_propagation_flags_from_string(const char *name, unsigned long *ret);
61
62 #if 0 /// UNNEEDED by elogind
63 int mount_option_mangle(
64                 const char *options,
65                 unsigned long mount_flags,
66                 unsigned long *ret_mount_flags,
67                 char **ret_remaining_options);
68 #endif // 0