1 /* SPDX-License-Identifier: LGPL-2.1-or-later */
4 typedef struct Mount Mount
;
7 #include "dynamic-user.h"
10 typedef enum MountExecCommand
{
14 _MOUNT_EXEC_COMMAND_MAX
,
15 _MOUNT_EXEC_COMMAND_INVALID
= -EINVAL
,
18 typedef enum MountResult
{
20 MOUNT_FAILURE_RESOURCES
, /* a bit of a misnomer, just our catch-all error for errnos we didn't expect */
21 MOUNT_FAILURE_TIMEOUT
,
22 MOUNT_FAILURE_EXIT_CODE
,
24 MOUNT_FAILURE_CORE_DUMP
,
25 MOUNT_FAILURE_START_LIMIT_HIT
,
26 MOUNT_FAILURE_PROTOCOL
,
28 _MOUNT_RESULT_INVALID
= -EINVAL
,
31 typedef struct MountParameters
{
37 /* Used while looking for mount points that vanished or got added from/to /proc/self/mountinfo */
38 typedef enum MountProcFlags
{
39 MOUNT_PROC_IS_MOUNTED
= 1 << 0,
40 MOUNT_PROC_JUST_MOUNTED
= 1 << 1,
41 MOUNT_PROC_JUST_CHANGED
= 1 << 2,
49 MountParameters parameters_proc_self_mountinfo
;
50 MountParameters parameters_fragment
;
52 bool from_proc_self_mountinfo
:1;
55 MountProcFlags proc_flags
;
65 MountResult reload_result
;
66 MountResult clean_result
;
68 mode_t directory_mode
;
72 ExecCommand exec_command
[_MOUNT_EXEC_COMMAND_MAX
];
74 ExecContext exec_context
;
75 KillContext kill_context
;
76 CGroupContext cgroup_context
;
78 ExecSharedRuntime
*exec_runtime
;
79 DynamicCreds dynamic_creds
;
81 MountState state
, deserialized_state
;
83 ExecCommand
* control_command
;
84 MountExecCommand control_command_id
;
87 sd_event_source
*timer_event_source
;
89 unsigned n_retry_umount
;
92 extern const UnitVTable mount_vtable
;
94 void mount_fd_event(Manager
*m
, int events
);
96 const char* mount_exec_command_to_string(MountExecCommand i
) _const_
;
97 MountExecCommand
mount_exec_command_from_string(const char *s
) _pure_
;
99 const char* mount_result_to_string(MountResult i
) _const_
;
100 MountResult
mount_result_from_string(const char *s
) _pure_
;
102 DEFINE_CAST(MOUNT
, Mount
);