1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2010 Lennart Poettering
9 systemd is free software; you can redistribute it and/or modify it
10 under the terms of the GNU Lesser General Public License as published by
11 the Free Software Foundation; either version 2.1 of the License, or
12 (at your option) any later version.
14 systemd is distributed in the hope that it will be useful, but
15 WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 Lesser General Public License for more details.
19 You should have received a copy of the GNU Lesser General Public License
20 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 typedef struct Mount Mount
;
26 #include "dynamic-user.h"
28 typedef enum MountExecCommand
{
32 _MOUNT_EXEC_COMMAND_MAX
,
33 _MOUNT_EXEC_COMMAND_INVALID
= -1
36 typedef enum MountResult
{
38 MOUNT_FAILURE_RESOURCES
,
39 MOUNT_FAILURE_TIMEOUT
,
40 MOUNT_FAILURE_EXIT_CODE
,
42 MOUNT_FAILURE_CORE_DUMP
,
43 MOUNT_FAILURE_START_LIMIT_HIT
,
45 _MOUNT_RESULT_INVALID
= -1
48 typedef struct MountParameters
{
59 MountParameters parameters_proc_self_mountinfo
;
60 MountParameters parameters_fragment
;
62 bool from_proc_self_mountinfo
:1;
65 /* Used while looking for mount points that vanished or got
66 * added from/to /proc/self/mountinfo */
77 MountResult reload_result
;
79 mode_t directory_mode
;
83 ExecCommand exec_command
[_MOUNT_EXEC_COMMAND_MAX
];
85 ExecContext exec_context
;
86 KillContext kill_context
;
87 CGroupContext cgroup_context
;
89 ExecRuntime
*exec_runtime
;
90 DynamicCreds dynamic_creds
;
92 MountState state
, deserialized_state
;
94 ExecCommand
* control_command
;
95 MountExecCommand control_command_id
;
98 sd_event_source
*timer_event_source
;
100 unsigned n_retry_umount
;
103 extern const UnitVTable mount_vtable
;
105 void mount_fd_event(Manager
*m
, int events
);
107 const char* mount_exec_command_to_string(MountExecCommand i
) _const_
;
108 MountExecCommand
mount_exec_command_from_string(const char *s
) _pure_
;
110 const char* mount_result_to_string(MountResult i
) _const_
;
111 MountResult
mount_result_from_string(const char *s
) _pure_
;