]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/mount.h
util: don't dump /proc/cpuinfo contents in debug info
[thirdparty/systemd.git] / src / core / mount.h
CommitLineData
c2f1db8f 1#pragma once
5cb5a6ff 2
a7334b09
LP
3/***
4 This file is part of systemd.
5
6 Copyright 2010 Lennart Poettering
7
8 systemd is free software; you can redistribute it and/or modify it
5430f7f2
LP
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
a7334b09
LP
11 (at your option) any later version.
12
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
5430f7f2 16 Lesser General Public License for more details.
a7334b09 17
5430f7f2 18 You should have received a copy of the GNU Lesser General Public License
a7334b09
LP
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
20***/
21
5cb5a6ff
LP
22typedef struct Mount Mount;
23
4ad49000 24#include "execute.h"
71d35b6b 25#include "kill.h"
5cb5a6ff 26
e537352b
LP
27typedef enum MountExecCommand {
28 MOUNT_EXEC_MOUNT,
29 MOUNT_EXEC_UNMOUNT,
30 MOUNT_EXEC_REMOUNT,
31 _MOUNT_EXEC_COMMAND_MAX,
32 _MOUNT_EXEC_COMMAND_INVALID = -1
33} MountExecCommand;
34
9d2f5178
LP
35typedef enum MountResult {
36 MOUNT_SUCCESS,
37 MOUNT_FAILURE_RESOURCES,
38 MOUNT_FAILURE_TIMEOUT,
39 MOUNT_FAILURE_EXIT_CODE,
40 MOUNT_FAILURE_SIGNAL,
41 MOUNT_FAILURE_CORE_DUMP,
42 _MOUNT_RESULT_MAX,
43 _MOUNT_RESULT_INVALID = -1
44} MountResult;
45
5bcb0f2b
LP
46typedef struct MountParameters {
47 char *what;
48 char *options;
49 char *fstype;
50} MountParameters;
51
5cb5a6ff 52struct Mount {
ac155bb8 53 Unit meta;
5cb5a6ff 54
e537352b 55 char *where;
b08d03ff 56
e537352b
LP
57 MountParameters parameters_proc_self_mountinfo;
58 MountParameters parameters_fragment;
f50e0a01 59
f50e0a01 60 bool from_proc_self_mountinfo:1;
e537352b 61 bool from_fragment:1;
ef734fd6
LP
62
63 /* Used while looking for mount points that vanished or got
64 * added from/to /proc/self/mountinfo */
e537352b
LP
65 bool is_mounted:1;
66 bool just_mounted:1;
67 bool just_changed:1;
68
5ad096b3
LP
69 bool reset_cpu_usage:1;
70
2dbd4a94
LP
71 bool sloppy_options;
72
9d2f5178
LP
73 MountResult result;
74 MountResult reload_result;
e537352b 75
3e5235b0
LP
76 mode_t directory_mode;
77
7fab9d01
LP
78 usec_t timeout_usec;
79
e537352b 80 ExecCommand exec_command[_MOUNT_EXEC_COMMAND_MAX];
4ad49000 81
e537352b 82 ExecContext exec_context;
4819ff03 83 KillContext kill_context;
4ad49000 84 CGroupContext cgroup_context;
e537352b 85
613b411c
LP
86 ExecRuntime *exec_runtime;
87
a16e1123 88 MountState state, deserialized_state;
e537352b 89
e537352b 90 ExecCommand* control_command;
a16e1123 91 MountExecCommand control_command_id;
e537352b
LP
92 pid_t control_pid;
93
718db961 94 sd_event_source *timer_event_source;
7d54a03a
LP
95
96 unsigned n_retry_umount;
5cb5a6ff
LP
97};
98
87f0e418 99extern const UnitVTable mount_vtable;
5cb5a6ff 100
ef734fd6
LP
101void mount_fd_event(Manager *m, int events);
102
44a6b1b6
ZJS
103const char* mount_exec_command_to_string(MountExecCommand i) _const_;
104MountExecCommand mount_exec_command_from_string(const char *s) _pure_;
a16e1123 105
44a6b1b6
ZJS
106const char* mount_result_to_string(MountResult i) _const_;
107MountResult mount_result_from_string(const char *s) _pure_;