]> git.ipfire.org Git - thirdparty/mdadm.git/commitdiff
Don't #include blkpg.h
authorNeil Brown <neilb@suse.de>
Mon, 16 Oct 2006 04:38:13 +0000 (14:38 +1000)
committerNeil Brown <neilb@suse.de>
Mon, 16 Oct 2006 04:38:13 +0000 (14:38 +1000)
Just include the content directly.  It is safer.

ChangeLog
util.c

index 5c66158f4ba8ad0a2a635cacc906c799e2de4970..e89a0dd5dba81f6f97f4a815a10d2422f121cb6c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+Changes Prior to this release
+    -   Don't #include linux/blkpg.h as that isn't safe.  Just
+       include the content literally.
+
 Changes Prior to 2.5.4 release
     -   When creating devices in /dev/md/ create matching symlinks
        from /dev.  e.g. /dev/md0 -> /dev/md/0.
diff --git a/util.c b/util.c
index f3b7a3970224ffba7f2201287dcdb3a18b03dfbc..1ccf4e1623dbe1f3002d381a0a7acb8c98ade55f 100644 (file)
--- a/util.c
+++ b/util.c
 #include       "md_p.h"
 #include       <sys/utsname.h>
 #include       <ctype.h>
-#include       <linux/blkpg.h>
+
+/*
+ * following taken from linux/blkpg.h because they aren't
+ * anywhere else and it isn't safe to #include linux/ * stuff.
+ */
+
+#define BLKPG      _IO(0x12,105)
+
+/* The argument structure */
+struct blkpg_ioctl_arg {
+        int op;
+        int flags;
+        int datalen;
+        void *data;
+};
+
+/* The subfunctions (for the op field) */
+#define BLKPG_ADD_PARTITION    1
+#define BLKPG_DEL_PARTITION    2
+
+/* Sizes of name fields. Unused at present. */
+#define BLKPG_DEVNAMELTH       64
+#define BLKPG_VOLNAMELTH       64
+
+/* The data structure for ADD_PARTITION and DEL_PARTITION */
+struct blkpg_partition {
+       long long start;                /* starting offset in bytes */
+       long long length;               /* length in bytes */
+       int pno;                        /* partition number */
+       char devname[BLKPG_DEVNAMELTH]; /* partition name, like sda5 or c0d1p2,
+                                          to be used in kernel messages */
+       char volname[BLKPG_VOLNAMELTH]; /* volume label */
+};
 
 /*
  * Parse a 128 bit uuid in 4 integers