chiark / gitweb /
[PATCH] update volume_id
[elogind.git] / extras / multipath-tools / libdevmapper / ioctl / libdm-compat.h
1 /*
2  * Copyright (C) 2001 Sistina Software (UK) Limited.
3  *
4  * This file is released under the LGPL.
5  */
6
7 #ifndef _LINUX_LIBDM_COMPAT_H
8 #define _LINUX_LIBDM_COMPAT_H
9
10 #include <inttypes.h>
11 #include <linux/dm-ioctl.h>
12 #include <linux/kdev_t.h>
13 #include <sys/ioctl.h>
14
15 struct dm_task;
16 struct dm_info;
17
18 /*
19  * Old versions of structures for backwards compatibility.
20  */
21
22 struct dm_ioctl_v1 {
23         uint32_t version[3];    /* in/out */
24         uint32_t data_size;     /* total size of data passed in
25                                  * including this struct */
26
27         uint32_t data_start;    /* offset to start of data
28                                  * relative to start of this struct */
29
30         int32_t target_count;   /* in/out */
31         int32_t open_count;     /* out */
32         uint32_t flags;         /* in/out */
33
34         __kernel_dev_t dev;     /* in/out */
35
36         char name[DM_NAME_LEN]; /* device name */
37         char uuid[DM_UUID_LEN]; /* unique identifier for
38                                  * the block device */
39 };
40
41 struct dm_target_spec_v1 {
42         int32_t status;         /* used when reading from kernel only */
43         uint64_t sector_start;
44         uint32_t length;
45         uint32_t next;
46
47         char target_type[DM_MAX_TYPE_NAME];
48
49 };
50
51 struct dm_target_deps_v1 {
52         uint32_t count;
53
54         __kernel_dev_t dev[0];  /* out */
55 };
56
57 enum {
58         /* Top level cmds */
59         DM_VERSION_CMD_V1 = 0,
60         DM_REMOVE_ALL_CMD_V1,
61
62         /* device level cmds */
63         DM_DEV_CREATE_CMD_V1,
64         DM_DEV_REMOVE_CMD_V1,
65         DM_DEV_RELOAD_CMD_V1,
66         DM_DEV_RENAME_CMD_V1,
67         DM_DEV_SUSPEND_CMD_V1,
68         DM_DEV_DEPS_CMD_V1,
69         DM_DEV_STATUS_CMD_V1,
70
71         /* target level cmds */
72         DM_TARGET_STATUS_CMD_V1,
73         DM_TARGET_WAIT_CMD_V1,
74 };
75
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)
78
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)
86
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)
89
90 /* *INDENT-OFF* */
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} },
108 };
109 /* *INDENT-ON* */
110
111 #endif