1 /* SPDX-License-Identifier: LGPL-2.1+ */
4 typedef struct Mount Mount
;
7 #include "dynamic-user.h"
10 typedef enum MountExecCommand
{
14 _MOUNT_EXEC_COMMAND_MAX
,
15 _MOUNT_EXEC_COMMAND_INVALID
= -1
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
= -1
31 typedef struct MountParameters
{
42 MountParameters parameters_proc_self_mountinfo
;
43 MountParameters parameters_fragment
;
45 bool from_proc_self_mountinfo
:1;
48 /* Used while looking for mount points that vanished or got
49 * added from/to /proc/self/mountinfo */
60 MountResult reload_result
;
62 mode_t directory_mode
;
66 ExecCommand exec_command
[_MOUNT_EXEC_COMMAND_MAX
];
68 ExecContext exec_context
;
69 KillContext kill_context
;
70 CGroupContext cgroup_context
;
72 ExecRuntime
*exec_runtime
;
73 DynamicCreds dynamic_creds
;
75 MountState state
, deserialized_state
;
77 ExecCommand
* control_command
;
78 MountExecCommand control_command_id
;
81 sd_event_source
*timer_event_source
;
83 unsigned n_retry_umount
;
86 extern const UnitVTable mount_vtable
;
88 void mount_fd_event(Manager
*m
, int events
);
90 const char* mount_exec_command_to_string(MountExecCommand i
) _const_
;
91 MountExecCommand
mount_exec_command_from_string(const char *s
) _pure_
;
93 const char* mount_result_to_string(MountResult i
) _const_
;
94 MountResult
mount_result_from_string(const char *s
) _pure_
;
96 DEFINE_CAST(MOUNT
, Mount
);