1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
7 This file is part of systemd.
9 Copyright 2010 Lennart Poettering
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
25 typedef struct Mount Mount;
29 typedef enum MountState {
31 MOUNT_MOUNTING, /* /bin/mount is running, but the mount is not done yet. */
32 MOUNT_MOUNTING_DONE, /* /bin/mount is running, and the mount is done. */
36 MOUNT_MOUNTING_SIGTERM,
37 MOUNT_MOUNTING_SIGKILL,
38 MOUNT_REMOUNTING_SIGTERM,
39 MOUNT_REMOUNTING_SIGKILL,
40 MOUNT_UNMOUNTING_SIGTERM,
41 MOUNT_UNMOUNTING_SIGKILL,
44 _MOUNT_STATE_INVALID = -1
47 typedef enum MountExecCommand {
51 _MOUNT_EXEC_COMMAND_MAX,
52 _MOUNT_EXEC_COMMAND_INVALID = -1
55 typedef struct MountParameters {
62 typedef enum MountResult {
64 MOUNT_FAILURE_RESOURCES,
65 MOUNT_FAILURE_TIMEOUT,
66 MOUNT_FAILURE_EXIT_CODE,
68 MOUNT_FAILURE_CORE_DUMP,
70 _MOUNT_RESULT_INVALID = -1
78 MountParameters parameters_proc_self_mountinfo;
79 MountParameters parameters_fragment;
81 bool from_proc_self_mountinfo:1;
84 /* Used while looking for mount points that vanished or got
85 * added from/to /proc/self/mountinfo */
91 MountResult reload_result;
93 mode_t directory_mode;
97 ExecCommand exec_command[_MOUNT_EXEC_COMMAND_MAX];
98 ExecContext exec_context;
100 MountState state, deserialized_state;
102 ExecCommand* control_command;
103 MountExecCommand control_command_id;
109 extern const UnitVTable mount_vtable;
111 void mount_fd_event(Manager *m, int events);
113 const char* mount_state_to_string(MountState i);
114 MountState mount_state_from_string(const char *s);
116 const char* mount_exec_command_to_string(MountExecCommand i);
117 MountExecCommand mount_exec_command_from_string(const char *s);
119 const char* mount_result_to_string(MountResult i);
120 MountResult mount_result_from_string(const char *s);