diff options
author | Neil Brown <neilb@suse.de> | 2006-10-16 14:38:13 +1000 |
---|---|---|
committer | Neil Brown <neilb@suse.de> | 2006-10-16 14:38:13 +1000 |
commit | 0a816ef9fb8202707cc76a943678307c252939cf (patch) | |
tree | 14082ac4e7bfceaa3cc524e42df93b5ed9efa445 /util.c | |
parent | 8e64e04456b036b23b86ed8219cb8f7c6a53eba6 (diff) | |
download | mdadm-0a816ef9fb8202707cc76a943678307c252939cf.tar.gz mdadm-0a816ef9fb8202707cc76a943678307c252939cf.tar.xz mdadm-0a816ef9fb8202707cc76a943678307c252939cf.zip |
Don't #include blkpg.h
Just include the content directly. It is safer.
Diffstat (limited to 'util.c')
-rw-r--r-- | util.c | 34 |
1 files changed, 33 insertions, 1 deletions
@@ -31,7 +31,39 @@ #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 |