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