]> git.ipfire.org Git - thirdparty/systemd.git/blame - src/core/automount.h
core: move enforcement of the start limit into per-unit-type code again
[thirdparty/systemd.git] / src / core / automount.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 Automount Automount;
23
87f0e418 24#include "unit.h"
5cb5a6ff 25
81a5c6d0
LP
26typedef enum AutomountResult {
27 AUTOMOUNT_SUCCESS,
28 AUTOMOUNT_FAILURE_RESOURCES,
07299350 29 AUTOMOUNT_FAILURE_START_LIMIT_HIT,
81a5c6d0
LP
30 _AUTOMOUNT_RESULT_MAX,
31 _AUTOMOUNT_RESULT_INVALID = -1
32} AutomountResult;
33
5cb5a6ff 34struct Automount {
ac155bb8 35 Unit meta;
5cb5a6ff 36
a16e1123 37 AutomountState state, deserialized_state;
5cb5a6ff 38
8d567588 39 char *where;
deb0a77c 40 usec_t timeout_idle_usec;
8d567588 41
8d567588 42 int pipe_fd;
718db961 43 sd_event_source *pipe_event_source;
7fab9d01 44 mode_t directory_mode;
8d567588
LP
45 dev_t dev_id;
46
47 Set *tokens;
deb0a77c
MO
48 Set *expire_tokens;
49
50 sd_event_source *expire_event_source;
8d567588 51
81a5c6d0 52 AutomountResult result;
5cb5a6ff
LP
53};
54
87f0e418 55extern const UnitVTable automount_vtable;
5cb5a6ff 56
deb0a77c 57int automount_update_mount(Automount *a, MountState old_state, MountState state);
8d567588 58
44a6b1b6
ZJS
59const char* automount_result_to_string(AutomountResult i) _const_;
60AutomountResult automount_result_from_string(const char *s) _pure_;