2002-12-10 22:42:28

by Kevin Corry

[permalink] [raw]
Subject: [PATCH] dm-ioctl.h - device-mapper ioctl packet fixes

Joe, Linus,

This patch fixes some device-mapper ioctl packet definitions in dm-ioctl.h
in 2.5.51.

Notes:
- The "dev" fields in "struct dm_ioctl" and "struct dm_target_deps" should
be fixed-size to avoid requiring translation code on architectures such as
ppc64 and sparc64 with 32-bit user-space and 64-bit kernel-space.
- The "length" field in "struct dm_target_spec" should be should be 64-bit
to allow single targets within a device to be greater than 2 TB.
- The "status" field in "struct dm_target_spec" should be moved to ensure
proper field alignment on 64-bit architectures.
- The version of the ioctl interface changes from 1.0.6 to 2.0.0, because
the new structure definitions are not backwards compatible with the previous
definitions.

--
Kevin Corry
[email protected]
http://evms.sourceforge.net/


--- linux-2.5.51a/include/linux/dm-ioctl.h Tue Dec 10 10:59:55 2002
+++ linux-2.5.51b/include/linux/dm-ioctl.h Wed Nov 20 14:44:06 2002
@@ -50,7 +50,7 @@
uint32_t open_count; /* out */
uint32_t flags; /* in/out */

- __kernel_dev_t dev; /* in/out */
+ uint32_t dev; /* in/out */

char name[DM_NAME_LEN]; /* device name */
char uuid[DM_UUID_LEN]; /* unique identifier for
@@ -62,9 +62,9 @@
* dm_ioctl.
*/
struct dm_target_spec {
- int32_t status; /* used when reading from kernel only */
uint64_t sector_start;
- uint32_t length;
+ uint64_t length;
+ int32_t status; /* used when reading from kernel only */

/*
* Offset in bytes (from the start of this struct) to
@@ -87,7 +87,7 @@
struct dm_target_deps {
uint32_t count;

- __kernel_dev_t dev[0]; /* out */
+ uint32_t dev[0]; /* out */
};

/*
@@ -129,10 +129,10 @@
#define DM_TARGET_STATUS _IOWR(DM_IOCTL, DM_TARGET_STATUS_CMD, struct dm_ioctl)
#define DM_TARGET_WAIT _IOWR(DM_IOCTL, DM_TARGET_WAIT_CMD, struct dm_ioctl)

-#define DM_VERSION_MAJOR 1
+#define DM_VERSION_MAJOR 2
#define DM_VERSION_MINOR 0
-#define DM_VERSION_PATCHLEVEL 6
-#define DM_VERSION_EXTRA "-ioctl (2002-10-15)"
+#define DM_VERSION_PATCHLEVEL 0
+#define DM_VERSION_EXTRA "-ioctl (2002-12-10)"

/* Status bits */
#define DM_READONLY_FLAG 0x00000001