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 */
71 bool reset_accounting
:1;
79 MountResult reload_result
;
81 mode_t directory_mode
;
85 ExecCommand exec_command
[_MOUNT_EXEC_COMMAND_MAX
];
87 ExecContext exec_context
;
88 KillContext kill_context
;
89 CGroupContext cgroup_context
;
91 ExecRuntime
*exec_runtime
;
92 DynamicCreds dynamic_creds
;
94 MountState state
, deserialized_state
;
96 ExecCommand
* control_command
;
97 MountExecCommand control_command_id
;
100 sd_event_source
*timer_event_source
;
102 unsigned n_retry_umount
;
105 extern const UnitVTable mount_vtable
;
107 void mount_fd_event(Manager
*m
, int events
);
109 const char* mount_exec_command_to_string(MountExecCommand i
) _const_
;
110 MountExecCommand
mount_exec_command_from_string(const char *s
) _pure_
;
112 const char* mount_result_to_string(MountResult i
) _const_
;
113 MountResult
mount_result_from_string(const char *s
) _pure_
;