]> err.no Git - util-linux/commitdiff
blockdev: add BLKDISCARDZEROES
authorKarel Zak <kzak@redhat.com>
Tue, 24 Aug 2010 09:43:21 +0000 (11:43 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 24 Aug 2010 09:47:55 +0000 (11:47 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/blockdev.c
include/blkdev.h

index cf594d12e3bbeec2e765668cbe395680fbc0022e..089405e9ec493484e6ebecb826211e2ce49fb6fa 100644 (file)
@@ -74,6 +74,12 @@ struct bdc bdcms[] =
                .argtype = ARG_INT,
                .argval = -1,
                .help = N_("get read-only")
+       },{
+               IOCTL_ENTRY(BLKDISCARDZEROES),
+               .name = "--getdiscardzeroes",
+               .argtype = ARG_UINT,
+               .argval = -1,
+               .help = N_("get discard zeroes support status")
        },{
                IOCTL_ENTRY(BLKSSZGET),
                .name = "--getss",
index 0eea01cd8d1987544fb771ae68af9d4012f2d62c..2179c6ed87d4365be4a0354a50bcd820de6cf589 100644 (file)
@@ -33,6 +33,7 @@
 
 #endif /* BLKROSET && __linux__ */
 
+
 #ifdef APPLE_DARWIN
 #define BLKGETSIZE DKIOCGETBLOCKCOUNT32
 #endif
 #define BLKPBSZGET _IO(0x12,123)
 #endif
 
+/* discard zeroes support, introduced in 2.6.33 (commait 98262f27) */
+#ifndef BLKDISCARDZEROES
+#define BLKDISCARDZEROES _IO(0x12,124)
+#endif
+
 #ifndef FIFREEZE
 #define FIFREEZE   _IOWR('X', 119, int)    /* Freeze */
 #define FITHAW     _IOWR('X', 120, int)    /* Thaw */