[DRBD-cvs] r1610 - branches/drbd-0.7/drbd/linux

svn at svn.drbd.org svn at svn.drbd.org
Thu Oct 21 12:09:17 CEST 2004


Author: phil
Date: 2004-10-21 12:09:14 +0200 (Thu, 21 Oct 2004)
New Revision: 1610

Modified:
   branches/drbd-0.7/drbd/linux/drbd.h
   branches/drbd-0.7/drbd/linux/drbd_config.h
Log:
Arranged ioctl structs to be friendly aligned on 64 architectures.
Breaks ioctl() binary API compatibility.


Modified: branches/drbd-0.7/drbd/linux/drbd.h
===================================================================
--- branches/drbd-0.7/drbd/linux/drbd.h	2004-10-20 23:50:56 UTC (rev 1609)
+++ branches/drbd-0.7/drbd/linux/drbd.h	2004-10-21 10:09:14 UTC (rev 1610)
@@ -45,6 +45,8 @@
 #define INOUT
 #endif
 
+/* Never forget to place bigger members before the smaller, to
+   avoid unaligned placement of members on 64 bit architectures. */
 
 #define MAX_SOCK_ADDR	128	/* 108 for Unix domain -
 				   16 for IP, 16 for IPX,
@@ -63,8 +65,8 @@
 
 
 struct __attribute__((packed)) disk_config {
+	IN __u64    disk_size;
 	IN int      lower_device;
-	IN __u64    disk_size;
 	IN enum io_error_handler on_io_error;
 	IN int      meta_device;
 	IN int      meta_index;
@@ -78,8 +80,8 @@
 
 struct __attribute__((packed)) net_config {
 	IN char     my_addr[MAX_SOCK_ADDR];
+	IN char     other_addr[MAX_SOCK_ADDR];
 	IN int      my_addr_len;
-	IN char     other_addr[MAX_SOCK_ADDR];
 	IN int      other_addr_len;
 	IN int      timeout;          // deci seconds
 	IN int      wire_protocol;
@@ -190,17 +192,17 @@
 #endif
 
 struct __attribute__((packed)) ioctl_get_config {
+	OUT __u64             disk_size_user;
+	OUT char              lower_device_name[BDEVNAME_SIZE];
+	OUT char              meta_device_name[BDEVNAME_SIZE];
 	struct net_config     nconf;
 	struct syncer_config  sconf;
 	OUT int               lower_device_major;
 	OUT int               lower_device_minor;
-	OUT __u64             disk_size_user;
 	OUT enum io_error_handler on_io_error;
 	OUT int               meta_device_major;
 	OUT int               meta_device_minor;
 	OUT int               meta_index;
-	OUT char              lower_device_name[BDEVNAME_SIZE];
-	OUT char              meta_device_name[BDEVNAME_SIZE];
 	OUT Drbd_CState       cstate;
 	OUT Drbd_State        state;
 	OUT Drbd_State        peer_state;

Modified: branches/drbd-0.7/drbd/linux/drbd_config.h
===================================================================
--- branches/drbd-0.7/drbd/linux/drbd_config.h	2004-10-20 23:50:56 UTC (rev 1609)
+++ branches/drbd-0.7/drbd/linux/drbd_config.h	2004-10-21 10:09:14 UTC (rev 1610)
@@ -23,7 +23,7 @@
 extern const char * drbd_buildtag(void);
 
 #define REL_VERSION "0.7.5"
-#define API_VERSION 76
+#define API_VERSION 77
 #define PRO_VERSION 74
 
 //#define DBG_ALL_SYMBOLS // no static functs, improves quality of OOPS traces



More information about the drbd-cvs mailing list