2 * Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved.
3 * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved.
5 * This file is part of the device-mapper userspace tools.
7 * This copyrighted material is made available to anyone wishing to use,
8 * modify, copy, or redistribute it subject to the terms and conditions
9 * of the GNU Lesser General Public License v.2.1.
11 * You should have received a copy of the GNU Lesser General Public License
12 * along with this program; if not, write to the Free Software Foundation,
13 * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 #ifndef _LINUX_LIBDM_COMPAT_H
17 #define _LINUX_LIBDM_COMPAT_H
22 #include <sys/ioctl.h>
28 * Old versions of structures for backwards compatibility.
32 uint32_t version[3]; /* in/out */
33 uint32_t data_size; /* total size of data passed in
34 * including this struct */
36 uint32_t data_start; /* offset to start of data
37 * relative to start of this struct */
39 int32_t target_count; /* in/out */
40 int32_t open_count; /* out */
41 uint32_t flags; /* in/out */
43 __kernel_dev_t dev; /* in/out */
45 char name[DM_NAME_LEN]; /* device name */
46 char uuid[DM_UUID_LEN]; /* unique identifier for
50 struct dm_target_spec_v1 {
51 int32_t status; /* used when reading from kernel only */
52 uint64_t sector_start;
56 char target_type[DM_MAX_TYPE_NAME];
60 struct dm_target_deps_v1 {
63 __kernel_dev_t dev[0]; /* out */
68 DM_VERSION_CMD_V1 = 0,
71 /* device level cmds */
76 DM_DEV_SUSPEND_CMD_V1,
80 /* target level cmds */
81 DM_TARGET_STATUS_CMD_V1,
82 DM_TARGET_WAIT_CMD_V1,
85 #define DM_VERSION_V1 _IOWR(DM_IOCTL, DM_VERSION_CMD_V1, struct dm_ioctl)
86 #define DM_REMOVE_ALL_V1 _IOWR(DM_IOCTL, DM_REMOVE_ALL_CMD_V1, struct dm_ioctl)
88 #define DM_DEV_CREATE_V1 _IOWR(DM_IOCTL, DM_DEV_CREATE_CMD_V1, struct dm_ioctl)
89 #define DM_DEV_REMOVE_V1 _IOWR(DM_IOCTL, DM_DEV_REMOVE_CMD_V1, struct dm_ioctl)
90 #define DM_DEV_RELOAD_V1 _IOWR(DM_IOCTL, DM_DEV_RELOAD_CMD_V1, struct dm_ioctl)
91 #define DM_DEV_SUSPEND_V1 _IOWR(DM_IOCTL, DM_DEV_SUSPEND_CMD_V1, struct dm_ioctl)
92 #define DM_DEV_RENAME_V1 _IOWR(DM_IOCTL, DM_DEV_RENAME_CMD_V1, struct dm_ioctl)
93 #define DM_DEV_DEPS_V1 _IOWR(DM_IOCTL, DM_DEV_DEPS_CMD_V1, struct dm_ioctl)
94 #define DM_DEV_STATUS_V1 _IOWR(DM_IOCTL, DM_DEV_STATUS_CMD_V1, struct dm_ioctl)
96 #define DM_TARGET_STATUS_V1 _IOWR(DM_IOCTL, DM_TARGET_STATUS_CMD_V1, struct dm_ioctl)
97 #define DM_TARGET_WAIT_V1 _IOWR(DM_IOCTL, DM_TARGET_WAIT_CMD_V1, struct dm_ioctl)
100 static struct cmd_data _cmd_data_v1[] = {
101 { "create", DM_DEV_CREATE_V1, {1, 0, 0} },
102 { "reload", DM_DEV_RELOAD_V1, {1, 0, 0} },
103 { "remove", DM_DEV_REMOVE_V1, {1, 0, 0} },
104 { "remove_all", DM_REMOVE_ALL_V1, {1, 0, 0} },
105 { "suspend", DM_DEV_SUSPEND_V1, {1, 0, 0} },
106 { "resume", DM_DEV_SUSPEND_V1, {1, 0, 0} },
107 { "info", DM_DEV_STATUS_V1, {1, 0, 0} },
108 { "deps", DM_DEV_DEPS_V1, {1, 0, 0} },
109 { "rename", DM_DEV_RENAME_V1, {1, 0, 0} },
110 { "version", DM_VERSION_V1, {1, 0, 0} },
111 { "status", DM_TARGET_STATUS_V1, {1, 0, 0} },
112 { "table", DM_TARGET_STATUS_V1, {1, 0, 0} },
113 { "waitevent", DM_TARGET_WAIT_V1, {1, 0, 0} },
114 { "names", 0, {4, 0, 0} },
115 { "clear", 0, {4, 0, 0} },
116 { "mknodes", 0, {4, 0, 0} },
117 { "versions", 0, {4, 1, 0} },
118 { "message", 0, {4, 2, 0} },
119 { "setgeometry",0, {4, 6, 0} },