1/**************************************************************************** 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 **************************************************************************** 11 ****************************************************************************/ 12#ifndef _LINUX_DM_IOCTL_V4_H 13#define _LINUX_DM_IOCTL_V4_H 14 15#include <linux/types.h> 16 17#define DM_DIR "mapper" 18#define DM_MAX_TYPE_NAME 16 19#define DM_NAME_LEN 128 20#define DM_UUID_LEN 129 21 22struct dm_ioctl { 23 24 uint32_t version[3]; 25 uint32_t data_size; 26 27 uint32_t data_start; 28 29 uint32_t target_count; 30 int32_t open_count; 31 uint32_t flags; 32 uint32_t event_nr; 33 uint32_t padding; 34 35 uint64_t dev; 36 37 char name[DM_NAME_LEN]; 38 char uuid[DM_UUID_LEN]; 39 char data[7]; 40}; 41 42struct dm_target_spec { 43 uint64_t sector_start; 44 uint64_t length; 45 int32_t status; 46 47 uint32_t next; 48 49 char target_type[DM_MAX_TYPE_NAME]; 50 51}; 52 53struct dm_target_deps { 54 uint32_t count; 55 uint32_t padding; 56 uint64_t dev[0]; 57}; 58 59struct dm_name_list { 60 uint64_t dev; 61 uint32_t next; 62 char name[0]; 63}; 64 65struct dm_target_versions { 66 uint32_t next; 67 uint32_t version[3]; 68 69 char name[0]; 70}; 71 72struct dm_target_msg { 73 uint64_t sector; 74 75 char message[0]; 76}; 77 78enum { 79 80 DM_VERSION_CMD = 0, 81 DM_REMOVE_ALL_CMD, 82 DM_LIST_DEVICES_CMD, 83 84 DM_DEV_CREATE_CMD, 85 DM_DEV_REMOVE_CMD, 86 DM_DEV_RENAME_CMD, 87 DM_DEV_SUSPEND_CMD, 88 DM_DEV_STATUS_CMD, 89 DM_DEV_WAIT_CMD, 90 91 DM_TABLE_LOAD_CMD, 92 DM_TABLE_CLEAR_CMD, 93 DM_TABLE_DEPS_CMD, 94 DM_TABLE_STATUS_CMD, 95 96 DM_LIST_VERSIONS_CMD, 97 DM_TARGET_MSG_CMD, 98 DM_DEV_SET_GEOMETRY_CMD 99}; 100 101#define DM_IOCTL 0xfd 102 103#define DM_VERSION _IOWR(DM_IOCTL, DM_VERSION_CMD, struct dm_ioctl) 104#define DM_REMOVE_ALL _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD, struct dm_ioctl) 105#define DM_LIST_DEVICES _IOWR(DM_IOCTL, DM_LIST_DEVICES_CMD, struct dm_ioctl) 106 107#define DM_DEV_CREATE _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD, struct dm_ioctl) 108#define DM_DEV_REMOVE _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD, struct dm_ioctl) 109#define DM_DEV_RENAME _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD, struct dm_ioctl) 110#define DM_DEV_SUSPEND _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD, struct dm_ioctl) 111#define DM_DEV_STATUS _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD, struct dm_ioctl) 112#define DM_DEV_WAIT _IOWR(DM_IOCTL, DM_DEV_WAIT_CMD, struct dm_ioctl) 113 114#define DM_TABLE_LOAD _IOWR(DM_IOCTL, DM_TABLE_LOAD_CMD, struct dm_ioctl) 115#define DM_TABLE_CLEAR _IOWR(DM_IOCTL, DM_TABLE_CLEAR_CMD, struct dm_ioctl) 116#define DM_TABLE_DEPS _IOWR(DM_IOCTL, DM_TABLE_DEPS_CMD, struct dm_ioctl) 117#define DM_TABLE_STATUS _IOWR(DM_IOCTL, DM_TABLE_STATUS_CMD, struct dm_ioctl) 118 119#define DM_LIST_VERSIONS _IOWR(DM_IOCTL, DM_LIST_VERSIONS_CMD, struct dm_ioctl) 120 121#define DM_TARGET_MSG _IOWR(DM_IOCTL, DM_TARGET_MSG_CMD, struct dm_ioctl) 122#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 123 124#define DM_VERSION_MAJOR 4 125#define DM_VERSION_MINOR 14 126#define DM_VERSION_PATCHLEVEL 0 127#define DM_VERSION_EXTRA "-ioctl (2008-04-23)" 128 129#define DM_READONLY_FLAG (1 << 0) 130#define DM_SUSPEND_FLAG (1 << 1) 131#define DM_PERSISTENT_DEV_FLAG (1 << 3) 132 133#define DM_STATUS_TABLE_FLAG (1 << 4) 134 135#define DM_ACTIVE_PRESENT_FLAG (1 << 5) 136#define DM_INACTIVE_PRESENT_FLAG (1 << 6) 137 138#define DM_BUFFER_FULL_FLAG (1 << 8) 139 140#define DM_SKIP_BDGET_FLAG (1 << 9) 141 142#define DM_SKIP_LOCKFS_FLAG (1 << 10) 143 144#define DM_NOFLUSH_FLAG (1 << 11) 145 146#endif 147