summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarel Zak2009-10-15 02:32:03 +0200
committerKarel Zak2009-10-15 02:32:03 +0200
commited98508a1cf5ebe67948b6c2ec7a65f4ddd110f8 (patch)
tree3b94f54dbfa3f9e74eaece52a1dea9e0bad6f8a1
parentblockdev: add topology ioctls support (diff)
downloadkernel-qcow2-util-linux-ed98508a1cf5ebe67948b6c2ec7a65f4ddd110f8.tar.gz
kernel-qcow2-util-linux-ed98508a1cf5ebe67948b6c2ec7a65f4ddd110f8.tar.xz
kernel-qcow2-util-linux-ed98508a1cf5ebe67948b6c2ec7a65f4ddd110f8.zip
blockdev: fix topology ioctls
kernel 2.6.32-rc4 (kvm): # blockdev -v --getss --getpbsz --getiomin --getioopt --getmaxsect --getalignoff /dev/sda get logical block (sector) size: 512 get physical block (sector) size: 512 get minimum I/O size: 512 get optimal I/O size: 0 get max sectors per request: 1024 get alignment offset: 0 Signed-off-by: Karel Zak <kzak@redhat.com>
-rw-r--r--disk-utils/blockdev.c2
-rw-r--r--include/blkdev.h8
2 files changed, 6 insertions, 4 deletions
diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c
index b0ae37d9e..b20c052f3 100644
--- a/disk-utils/blockdev.c
+++ b/disk-utils/blockdev.c
@@ -101,7 +101,7 @@ struct bdc bdcms[] =
IOCTL_ENTRY(BLKALIGNOFF),
.name = "--getalignoff",
.argtype = ARG_INT,
- .argtype = -1,
+ .argval = -1,
.help = N_("get alignment offset")
},{
IOCTL_ENTRY(BLKSECTGET),
diff --git a/include/blkdev.h b/include/blkdev.h
index 57ef40d49..56a9c1f47 100644
--- a/include/blkdev.h
+++ b/include/blkdev.h
@@ -34,13 +34,15 @@
#define BLKBSZSET _IOW(0x12,113,size_t)
#define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
+#endif /* BLKROSET */
+
/* block device topology ioctls, introduced in 2.6.32 */
-#define BLKIOMIN _IO(0x1,120)
+#ifndef BLKIOMIN
+#define BLKIOMIN _IO(0x12,120)
#define BLKIOOPT _IO(0x12,121)
#define BLKALIGNOFF _IO(0x12,122)
#define BLKPBSZGET _IO(0x12,123)
-
-#endif /* BLKROSET */
+#endif
#ifndef HDIO_GETGEO
# ifdef __linux__