]>
Commit | Line | Data |
---|---|---|
53e1b683 | 1 | /* SPDX-License-Identifier: LGPL-2.1+ */ |
c2f1db8f | 2 | #pragma once |
5cb5a6ff | 3 | |
a7334b09 LP |
4 | /*** |
5 | This file is part of systemd. | |
6 | ||
7 | Copyright 2010 Lennart Poettering | |
a7334b09 LP |
8 | ***/ |
9 | ||
5cb5a6ff LP |
10 | typedef struct Device Device; |
11 | ||
628c89cc LP |
12 | typedef enum DeviceFound { |
13 | DEVICE_NOT_FOUND = 0, | |
14 | DEVICE_FOUND_UDEV = 1, | |
15 | DEVICE_FOUND_MOUNT = 2, | |
16 | DEVICE_FOUND_SWAP = 4, | |
17 | } DeviceFound; | |
18 | ||
5cb5a6ff | 19 | struct Device { |
ac155bb8 | 20 | Unit meta; |
5cb5a6ff | 21 | |
25ac040b | 22 | char *sysfs; |
628c89cc | 23 | DeviceFound found; |
8fe914ec | 24 | |
35b8ca3a | 25 | /* In order to be able to distinguish dependencies on |
8fe914ec LP |
26 | different device nodes we might end up creating multiple |
27 | devices for the same sysfs path. We chain them up here. */ | |
8fe914ec | 28 | LIST_FIELDS(struct Device, same_sysfs); |
7fab9d01 | 29 | |
f6200941 | 30 | DeviceState state, deserialized_state; |
ebc8968b FB |
31 | |
32 | bool bind_mounts; | |
5cb5a6ff LP |
33 | }; |
34 | ||
87f0e418 | 35 | extern const UnitVTable device_vtable; |
5cb5a6ff | 36 | |
628c89cc | 37 | int device_found_node(Manager *m, const char *node, bool add, DeviceFound found, bool now); |
ebc8968b | 38 | bool device_shall_be_bound_by(Unit *device, Unit *u); |