2 * Copyright (C) 2001 Sistina Software (UK) Limited.
4 * This file is released under the LGPL.
7 #ifndef _LINUX_LIBDM_COMPAT_H
8 #define _LINUX_LIBDM_COMPAT_H
11 #include <linux/dm-ioctl.h>
12 #include <linux/kdev_t.h>
13 #include <sys/ioctl.h>
19 * Old versions of structures for backwards compatibility.
23 uint32_t version[3]; /* in/out */
24 uint32_t data_size; /* total size of data passed in
25 * including this struct */
27 uint32_t data_start; /* offset to start of data
28 * relative to start of this struct */
30 int32_t target_count; /* in/out */
31 int32_t open_count; /* out */
32 uint32_t flags; /* in/out */
34 __kernel_dev_t dev; /* in/out */
36 char name[DM_NAME_LEN]; /* device name */
37 char uuid[DM_UUID_LEN]; /* unique identifier for
41 struct dm_target_spec_v1 {
42 int32_t status; /* used when reading from kernel only */
43 uint64_t sector_start;
47 char target_type[DM_MAX_TYPE_NAME];
51 struct dm_target_deps_v1 {
54 __kernel_dev_t dev[0]; /* out */
59 DM_VERSION_CMD_V1 = 0,
62 /* device level cmds */
67 DM_DEV_SUSPEND_CMD_V1,
71 /* target level cmds */
72 DM_TARGET_STATUS_CMD_V1,
73 DM_TARGET_WAIT_CMD_V1,
76 #define DM_VERSION_V1 _IOWR(DM_IOCTL, DM_VERSION_CMD_V1, struct dm_ioctl)
77 #define DM_REMOVE_ALL_V1 _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD_V1, struct dm_ioctl)
79 #define DM_DEV_CREATE_V1 _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD_V1, struct dm_ioctl)
80 #define DM_DEV_REMOVE_V1 _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD_V1, struct dm_ioctl)
81 #define DM_DEV_RELOAD_V1 _IOWR(DM_IOCTL, DM_DEV_RELOAD_CMD_V1, struct dm_ioctl)
82 #define DM_DEV_SUSPEND_V1 _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD_V1, struct dm_ioctl)
83 #define DM_DEV_RENAME_V1 _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD_V1, struct dm_ioctl)
84 #define DM_DEV_DEPS_V1 _IOWR(DM_IOCTL, DM_DEV_DEPS_CMD_V1, struct dm_ioctl)
85 #define DM_DEV_STATUS_V1 _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD_V1, struct dm_ioctl)
87 #define DM_TARGET_STATUS_V1 _IOWR(DM_IOCTL, DM_TARGET_STATUS_CMD_V1, struct dm_ioctl)
88 #define DM_TARGET_WAIT_V1 _IOWR(DM_IOCTL, DM_TARGET_WAIT_CMD_V1, struct dm_ioctl)
91 static struct cmd_data _cmd_data_v1[] = {
92 { "create", DM_DEV_CREATE_V1, {1, 0, 0} },
93 { "reload", DM_DEV_RELOAD_V1, {1, 0, 0} },
94 { "remove", DM_DEV_REMOVE_V1, {1, 0, 0} },
95 { "remove_all", DM_REMOVE_ALL_V1, {1, 0, 0} },
96 { "suspend", DM_DEV_SUSPEND_V1, {1, 0, 0} },
97 { "resume", DM_DEV_SUSPEND_V1, {1, 0, 0} },
98 { "info", DM_DEV_STATUS_V1, {1, 0, 0} },
99 { "deps", DM_DEV_DEPS_V1, {1, 0, 0} },
100 { "rename", DM_DEV_RENAME_V1, {1, 0, 0} },
101 { "version", DM_VERSION_V1, {1, 0, 0} },
102 { "status", DM_TARGET_STATUS_V1, {1, 0, 0} },
103 { "table", DM_TARGET_STATUS_V1, {1, 0, 0} },
104 { "waitevent", DM_TARGET_WAIT_V1, {1, 0, 0} },
105 { "names", 0, {4, 0, 0} },
106 { "clear", 0, {4, 0, 0} },
107 { "mknodes", 0, {4, 0, 0} },