blob: 51e997ff17f267f074ca54dabf91900beda4a0a3 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef _LINUX_DM_IOCTL_V4_H
20#define _LINUX_DM_IOCTL_V4_H
21#include <linux/types.h>
22#define DM_DIR "mapper"
Ben Cheng655a7c02013-10-16 16:09:24 -070023#define DM_CONTROL_NODE "control"
24#define DM_MAX_TYPE_NAME 16
25#define DM_NAME_LEN 128
26#define DM_UUID_LEN 129
Ben Cheng655a7c02013-10-16 16:09:24 -070027struct dm_ioctl {
Tao Baod7db5942015-01-28 10:07:51 -080028 __u32 version[3];
29 __u32 data_size;
30 __u32 data_start;
Tao Baod7db5942015-01-28 10:07:51 -080031 __u32 target_count;
32 __s32 open_count;
33 __u32 flags;
34 __u32 event_nr;
Tao Baod7db5942015-01-28 10:07:51 -080035 __u32 padding;
36 __u64 dev;
37 char name[DM_NAME_LEN];
38 char uuid[DM_UUID_LEN];
Tao Baod7db5942015-01-28 10:07:51 -080039 char data[7];
Ben Cheng655a7c02013-10-16 16:09:24 -070040};
41struct dm_target_spec {
Tao Baod7db5942015-01-28 10:07:51 -080042 __u64 sector_start;
Tao Baod7db5942015-01-28 10:07:51 -080043 __u64 length;
44 __s32 status;
45 __u32 next;
46 char target_type[DM_MAX_TYPE_NAME];
Ben Cheng655a7c02013-10-16 16:09:24 -070047};
48struct dm_target_deps {
Tao Baod7db5942015-01-28 10:07:51 -080049 __u32 count;
50 __u32 padding;
Tao Baod7db5942015-01-28 10:07:51 -080051 __u64 dev[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070052};
53struct dm_name_list {
Tao Baod7db5942015-01-28 10:07:51 -080054 __u64 dev;
Tao Baod7db5942015-01-28 10:07:51 -080055 __u32 next;
56 char name[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070057};
58struct dm_target_versions {
Tao Baod7db5942015-01-28 10:07:51 -080059 __u32 next;
60 __u32 version[3];
61 char name[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070062};
Ben Cheng655a7c02013-10-16 16:09:24 -070063struct dm_target_msg {
Tao Baod7db5942015-01-28 10:07:51 -080064 __u64 sector;
65 char message[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070066};
Ben Cheng655a7c02013-10-16 16:09:24 -070067enum {
Tao Baod7db5942015-01-28 10:07:51 -080068 DM_VERSION_CMD = 0,
69 DM_REMOVE_ALL_CMD,
70 DM_LIST_DEVICES_CMD,
Tao Baod7db5942015-01-28 10:07:51 -080071 DM_DEV_CREATE_CMD,
72 DM_DEV_REMOVE_CMD,
73 DM_DEV_RENAME_CMD,
74 DM_DEV_SUSPEND_CMD,
Tao Baod7db5942015-01-28 10:07:51 -080075 DM_DEV_STATUS_CMD,
76 DM_DEV_WAIT_CMD,
77 DM_TABLE_LOAD_CMD,
78 DM_TABLE_CLEAR_CMD,
Tao Baod7db5942015-01-28 10:07:51 -080079 DM_TABLE_DEPS_CMD,
80 DM_TABLE_STATUS_CMD,
81 DM_LIST_VERSIONS_CMD,
82 DM_TARGET_MSG_CMD,
Christopher Ferris1308ad32017-11-14 17:32:13 -080083 DM_DEV_SET_GEOMETRY_CMD,
84 DM_DEV_ARM_POLL_CMD,
Christopher Ferris9584fa42019-12-09 15:36:13 -080085 DM_GET_TARGET_VERSION_CMD,
Ben Cheng655a7c02013-10-16 16:09:24 -070086};
87#define DM_IOCTL 0xfd
88#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl)
Ben Cheng655a7c02013-10-16 16:09:24 -070089#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl)
90#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl)
91#define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl)
92#define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl)
Ben Cheng655a7c02013-10-16 16:09:24 -070093#define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl)
94#define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl)
95#define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl)
96#define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl)
Christopher Ferris1308ad32017-11-14 17:32:13 -080097#define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, DM_DEV_ARM_POLL_CMD, struct dm_ioctl)
Ben Cheng655a7c02013-10-16 16:09:24 -070098#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl)
99#define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl)
100#define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl)
101#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl)
Ben Cheng655a7c02013-10-16 16:09:24 -0700102#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl)
Christopher Ferris9584fa42019-12-09 15:36:13 -0800103#define DM_GET_TARGET_VERSION _IOWR(DM_IOCTL, DM_GET_TARGET_VERSION_CMD, struct dm_ioctl)
Ben Cheng655a7c02013-10-16 16:09:24 -0700104#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl)
105#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
106#define DM_VERSION_MAJOR 4
Christopher Ferris9584fa42019-12-09 15:36:13 -0800107#define DM_VERSION_MINOR 41
Ben Cheng655a7c02013-10-16 16:09:24 -0700108#define DM_VERSION_PATCHLEVEL 0
Christopher Ferris9584fa42019-12-09 15:36:13 -0800109#define DM_VERSION_EXTRA "-ioctl(2019-09-16)"
Ben Cheng655a7c02013-10-16 16:09:24 -0700110#define DM_READONLY_FLAG (1 << 0)
Ben Cheng655a7c02013-10-16 16:09:24 -0700111#define DM_SUSPEND_FLAG (1 << 1)
112#define DM_PERSISTENT_DEV_FLAG (1 << 3)
113#define DM_STATUS_TABLE_FLAG (1 << 4)
114#define DM_ACTIVE_PRESENT_FLAG (1 << 5)
Ben Cheng655a7c02013-10-16 16:09:24 -0700115#define DM_INACTIVE_PRESENT_FLAG (1 << 6)
116#define DM_BUFFER_FULL_FLAG (1 << 8)
117#define DM_SKIP_BDGET_FLAG (1 << 9)
118#define DM_SKIP_LOCKFS_FLAG (1 << 10)
Ben Cheng655a7c02013-10-16 16:09:24 -0700119#define DM_NOFLUSH_FLAG (1 << 11)
120#define DM_QUERY_INACTIVE_TABLE_FLAG (1 << 12)
121#define DM_UEVENT_GENERATED_FLAG (1 << 13)
122#define DM_UUID_FLAG (1 << 14)
Ben Cheng655a7c02013-10-16 16:09:24 -0700123#define DM_SECURE_DATA_FLAG (1 << 15)
124#define DM_DATA_OUT_FLAG (1 << 16)
Christopher Ferris38062f92014-07-09 15:33:25 -0700125#define DM_DEFERRED_REMOVE (1 << 17)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800126#define DM_INTERNAL_SUSPEND_FLAG (1 << 18)
Christopher Ferris05d08e92016-02-04 13:16:38 -0800127#endif