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