]> err.no Git - util-linux/commitdiff
blockdev: fix topology ioctls
authorKarel Zak <kzak@redhat.com>
Thu, 15 Oct 2009 00:32:03 +0000 (02:32 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 15 Oct 2009 00:32:03 +0000 (02:32 +0200)
 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>
disk-utils/blockdev.c
include/blkdev.h

index b0ae37d9e83153c594827004d793c99b1243182d..b20c052f32ac5b09ee3d7f7ae759cf58c69596e7 100644 (file)
@@ -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),
index 57ef40d498593fc1e738a02fbc212239b0bfe7a7..56a9c1f473fdcb032a6b5f5bb8dc198c5fc5db48 100644 (file)
 #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__