1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 Copyright 2010 Lennart Poettering
8 typedef struct Mount Mount
;
11 #include "dynamic-user.h"
14 typedef enum MountExecCommand
{
18 _MOUNT_EXEC_COMMAND_MAX
,
19 _MOUNT_EXEC_COMMAND_INVALID
= -1
22 typedef enum MountResult
{
24 MOUNT_FAILURE_RESOURCES
, /* a bit of a misnomer, just our catch-all error for errnos we didn't expect */
25 MOUNT_FAILURE_TIMEOUT
,
26 MOUNT_FAILURE_EXIT_CODE
,
28 MOUNT_FAILURE_CORE_DUMP
,
29 MOUNT_FAILURE_START_LIMIT_HIT
,
30 MOUNT_FAILURE_PROTOCOL
,
32 _MOUNT_RESULT_INVALID
= -1
35 typedef struct MountParameters
{
46 MountParameters parameters_proc_self_mountinfo
;
47 MountParameters parameters_fragment
;
49 bool from_proc_self_mountinfo
:1;
52 /* Used while looking for mount points that vanished or got
53 * added from/to /proc/self/mountinfo */
64 MountResult reload_result
;
66 mode_t directory_mode
;
70 ExecCommand exec_command
[_MOUNT_EXEC_COMMAND_MAX
];
72 ExecContext exec_context
;
73 KillContext kill_context
;
74 CGroupContext cgroup_context
;
76 ExecRuntime
*exec_runtime
;
77 DynamicCreds dynamic_creds
;
79 MountState state
, deserialized_state
;
81 ExecCommand
* control_command
;
82 MountExecCommand control_command_id
;
85 sd_event_source
*timer_event_source
;
87 unsigned n_retry_umount
;
90 extern const UnitVTable mount_vtable
;
92 void mount_fd_event(Manager
*m
, int events
);
94 const char* mount_exec_command_to_string(MountExecCommand i
) _const_
;
95 MountExecCommand
mount_exec_command_from_string(const char *s
) _pure_
;
97 const char* mount_result_to_string(MountResult i
) _const_
;
98 MountResult
mount_result_from_string(const char *s
) _pure_
;
100 DEFINE_CAST(MOUNT
, Mount
);