]> www.infradead.org Git - users/hch/blktests.git/commitdiff
zbdioctl: copy ioctl definitions from kernel
authorOmar Sandoval <osandov@fb.com>
Wed, 6 Feb 2019 01:19:13 +0000 (17:19 -0800)
committerOmar Sandoval <osandov@fb.com>
Wed, 6 Feb 2019 01:19:13 +0000 (17:19 -0800)
blkzoned.h may not have the recent BLKGETZONESZ or BLKGETNRZONES ioctls,
so just copy the definition.

Signed-off-by: Omar Sandoval <osandov@fb.com>
src/zbdioctl.c

index 1ea72e8e4816ca1f83ead139e3d08f4ed567af65..93a0f88431b5d6412ca0516823796a3496a938af 100644 (file)
@@ -9,14 +9,12 @@
 #include <linux/blkzoned.h>
 #include <linux/types.h>
 
-#if !defined(BLKGETZONESZ) || !defined(BLKGETNRZONES)
-
-int main(int argc, char **argv)
-{
-       return EXIT_FAILURE;
-}
-
-#else
+#ifndef BLKGETZONESZ
+#define BLKGETZONESZ   _IOR(0x12, 132, __u32)
+#endif
+#ifndef BLKGETNRZONES
+#define BLKGETNRZONES  _IOR(0x12, 133, __u32)
+#endif
 
 struct request {
        const char *name;
@@ -78,6 +76,3 @@ int main(int argc, char **argv)
 
        return EXIT_SUCCESS;
 }
-
-#endif
-