[dm-devel] [PATCH] dm-ioctl.h : Fixed field sizes and 64-bit alignments

Kevin Corry corryk at us.ibm.com
Fri Feb 28 13:19:09 UTC 2003


Hi,

I sent in a patch a while ago that makes some changes to the DM ioctl
packet defintitions. Alasdair mentioned at one point that you intend
to merge that patch, but are still in the process of testing. I was
just wondering if that patch is still scheduled to be included, and
if you had any timeline in mind. I have included it again, for
review/discussion. [The patch is against an old kernel version, but
should still apply.]

Thanks!
-- 
Kevin Corry
corryk at us.ibm.com
http://evms.sourceforge.net/


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

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.


--- 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




More information about the dm-devel mailing list