]> err.no Git - util-linux/commitdiff
blockdev: add topology ioctls support
authorKarel Zak <kzak@redhat.com>
Wed, 14 Oct 2009 23:22:42 +0000 (01:22 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 14 Oct 2009 23:22:42 +0000 (01:22 +0200)
new options:

   --getpbsz                      get physical block (sector) size
   --getiomin                     get minimum I/O size
   --getioopt                     get optimal I/O size
   --getalignoff                  get alignment offset
   --getmaxsect                   get max sectors per request

Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/blockdev.c
include/blkdev.h

index b6c6415fddfd6996011f000e5ab088ce3edfa3bc..b0ae37d9e83153c594827004d793c99b1243182d 100644 (file)
@@ -78,7 +78,37 @@ struct bdc bdcms[] =
                .name = "--getss",
                .argtype = ARG_INT,
                .argval = -1,
-               .help = N_("get sectorsize")
+               .help = N_("get logical block (sector) size")
+       },{
+               IOCTL_ENTRY(BLKPBSZGET),
+               .name = "--getpbsz",
+               .argtype = ARG_UINT,
+               .argval = -1,
+               .help = N_("get physical block (sector) size")
+       },{
+               IOCTL_ENTRY(BLKIOMIN),
+               .name = "--getiomin",
+               .argtype = ARG_UINT,
+               .argval = -1,
+               .help = N_("get minimum I/O size")
+       },{
+               IOCTL_ENTRY(BLKIOOPT),
+               .name = "--getioopt",
+               .argtype = ARG_UINT,
+               .argval = -1,
+               .help = N_("get optimal I/O size")
+       },{
+               IOCTL_ENTRY(BLKALIGNOFF),
+               .name = "--getalignoff",
+               .argtype = ARG_INT,
+               .argtype = -1,
+               .help = N_("get alignment offset")
+       },{
+               IOCTL_ENTRY(BLKSECTGET),
+               .name = "--getmaxsect",
+               .argtype = ARG_USHRT,
+               .argval = -1,
+               .help = N_("get max sectors per request")
        },{
                IOCTL_ENTRY(BLKBSZGET),
                .name = "--getbsz",
index 9d9453bc7d60112436410dbc1d3690b5556f31cf..57ef40d498593fc1e738a02fbc212239b0bfe7a7 100644 (file)
 #define BLKBSZSET  _IOW(0x12,113,size_t)
 #define BLKGETSIZE64 _IOR(0x12,114,size_t) /* return device size in bytes (u64 *arg) */
 
+/* block device topology ioctls, introduced in 2.6.32 */
+#define BLKIOMIN   _IO(0x1,120)
+#define BLKIOOPT   _IO(0x12,121)
+#define BLKALIGNOFF _IO(0x12,122)
+#define BLKPBSZGET _IO(0x12,123)
+
 #endif /* BLKROSET */
 
 #ifndef HDIO_GETGEO