4 This file is part of systemd.
6 Copyright 2010 Lennart Poettering
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
22 typedef struct Mount Mount
;
25 #include "dynamic-user.h"
27 typedef enum MountExecCommand
{
31 _MOUNT_EXEC_COMMAND_MAX
,
32 _MOUNT_EXEC_COMMAND_INVALID
= -1
35 typedef enum MountResult
{
37 MOUNT_FAILURE_RESOURCES
,
38 MOUNT_FAILURE_TIMEOUT
,
39 MOUNT_FAILURE_EXIT_CODE
,
41 MOUNT_FAILURE_CORE_DUMP
,
42 MOUNT_FAILURE_START_LIMIT_HIT
,
44 _MOUNT_RESULT_INVALID
= -1
47 typedef struct MountParameters
{
58 MountParameters parameters_proc_self_mountinfo
;
59 MountParameters parameters_fragment
;
61 bool from_proc_self_mountinfo
:1;
64 /* Used while looking for mount points that vanished or got
65 * added from/to /proc/self/mountinfo */
70 bool reset_accounting
:1;
78 MountResult reload_result
;
80 mode_t directory_mode
;
84 ExecCommand exec_command
[_MOUNT_EXEC_COMMAND_MAX
];
86 ExecContext exec_context
;
87 KillContext kill_context
;
88 CGroupContext cgroup_context
;
90 ExecRuntime
*exec_runtime
;
91 DynamicCreds dynamic_creds
;
93 MountState state
, deserialized_state
;
95 ExecCommand
* control_command
;
96 MountExecCommand control_command_id
;
99 sd_event_source
*timer_event_source
;
101 unsigned n_retry_umount
;
104 extern const UnitVTable mount_vtable
;
106 void mount_fd_event(Manager
*m
, int events
);
108 const char* mount_exec_command_to_string(MountExecCommand i
) _const_
;
109 MountExecCommand
mount_exec_command_from_string(const char *s
) _pure_
;
111 const char* mount_result_to_string(MountResult i
) _const_
;
112 MountResult
mount_result_from_string(const char *s
) _pure_
;
114 const char *mount_get_fstype(const Mount
*m
);