Sync usage with man page.
[netbsd-mini2440.git] / external / gpl2 / lvm2 / dist / libdm / ioctl / libdm-compat.h
bloba63fe8c78f74a36b264b4374814bfb69c8a9383e
1 /* $NetBSD$ */
3 /*
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
21 #include "kdev_t.h"
22 #include "dm-ioctl.h"
23 #include <inttypes.h>
24 #include <sys/ioctl.h>
26 struct dm_task;
27 struct dm_info;
30 * Old versions of structures for backwards compatibility.
33 struct dm_ioctl_v1 {
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
49 * the block device */
52 struct dm_target_spec_v1 {
53 int32_t status; /* used when reading from kernel only */
54 uint64_t sector_start;
55 uint32_t length;
56 uint32_t next;
58 char target_type[DM_MAX_TYPE_NAME];
62 struct dm_target_deps_v1 {
63 uint32_t count;
65 __kernel_dev_t dev[0]; /* out */
68 enum {
69 /* Top level cmds */
70 DM_VERSION_CMD_V1 = 0,
71 DM_REMOVE_ALL_CMD_V1,
73 /* device level cmds */
74 DM_DEV_CREATE_CMD_V1,
75 DM_DEV_REMOVE_CMD_V1,
76 DM_DEV_RELOAD_CMD_V1,
77 DM_DEV_RENAME_CMD_V1,
78 DM_DEV_SUSPEND_CMD_V1,
79 DM_DEV_DEPS_CMD_V1,
80 DM_DEV_STATUS_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)
101 /* *INDENT-OFF* */
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} },
123 /* *INDENT-ON* */
125 #endif