]> granicus.if.org Git - strace/commitdiff
block: move fallback definitions for ioctl commands to xlat
authorEugene Syromyatnikov <evgsyr@gmail.com>
Sat, 25 Aug 2018 20:02:35 +0000 (22:02 +0200)
committerDmitry V. Levin <ldv@altlinux.org>
Sat, 1 Sep 2018 14:38:12 +0000 (14:38 +0000)
* xlat/block_ioctl_cmds.in: New file.
* block.c: Include "xlat/block_ioctl_cmds.h" in XLAT_MACROS_ONLY mode.
(BLKPG, BLKTRACESETUP, BLKTRACESTART, BLKTRACESTOP, BLKTRACETEARDOWN,
BLKDISCARD, BLKIOMIN, BLKIOOPT, BLKALIGNOFF, BLKPBSZGET,
BLKDISCARDZEROES, BLKSECDISCARD, BLKROTATIONAL, BLKZEROOUT): Remove
fallback definitions as those are porvided by block_ioctl_cmds xlat now.

block.c
xlat/block_ioctl_cmds.in [new file with mode: 0644]

diff --git a/block.c b/block.c
index 58e9404fae74f919f00ee5881ae1e1ee74e9bcd5..477fea2c0a27b0b9716014f66da85db7ff6b838b 100644 (file)
--- a/block.c
+++ b/block.c
@@ -65,60 +65,15 @@ typedef struct blk_user_trace_setup {
        uint32_t pid;
 } struct_blk_user_trace_setup;
 
+/* Provide fall-back definitions for BLK* ioctls */
+#define XLAT_MACROS_ONLY
+# include "xlat/block_ioctl_cmds.h"
+#undef XLAT_MACROS_ONLY
+
 #include MPERS_DEFS
 
 #include "print_fields.h"
 
-#ifndef BLKPG
-# define BLKPG      _IO(0x12, 105)
-#endif
-
-/*
- * ioctl numbers <= 114 are present in Linux 2.4.  The following ones have been
- * added since then and headers containing them may not be available on every
- * system.
- */
-
-#ifndef BLKTRACESETUP
-# define BLKTRACESETUP _IOWR(0x12, 115, struct_blk_user_trace_setup)
-#endif
-#ifndef BLKTRACESTART
-# define BLKTRACESTART _IO(0x12, 116)
-#endif
-#ifndef BLKTRACESTOP
-# define BLKTRACESTOP _IO(0x12, 117)
-#endif
-#ifndef BLKTRACETEARDOWN
-# define BLKTRACETEARDOWN _IO(0x12, 118)
-#endif
-#ifndef BLKDISCARD
-# define BLKDISCARD _IO(0x12, 119)
-#endif
-#ifndef BLKIOMIN
-# define BLKIOMIN _IO(0x12, 120)
-#endif
-#ifndef BLKIOOPT
-# define BLKIOOPT _IO(0x12, 121)
-#endif
-#ifndef BLKALIGNOFF
-# define BLKALIGNOFF _IO(0x12, 122)
-#endif
-#ifndef BLKPBSZGET
-# define BLKPBSZGET _IO(0x12, 123)
-#endif
-#ifndef BLKDISCARDZEROES
-# define BLKDISCARDZEROES _IO(0x12, 124)
-#endif
-#ifndef BLKSECDISCARD
-# define BLKSECDISCARD _IO(0x12, 125)
-#endif
-#ifndef BLKROTATIONAL
-# define BLKROTATIONAL _IO(0x12, 126)
-#endif
-#ifndef BLKZEROOUT
-# define BLKZEROOUT _IO(0x12, 127)
-#endif
-
 #include "xlat/blkpg_ops.h"
 
 static void
diff --git a/xlat/block_ioctl_cmds.in b/xlat/block_ioctl_cmds.in
new file mode 100644 (file)
index 0000000..7863ac1
--- /dev/null
@@ -0,0 +1,35 @@
+BLKROSET               _IO(0x12, 93)
+BLKROGET               _IO(0x12, 94)
+BLKRRPART              _IO(0x12, 95)
+BLKGETSIZE             _IO(0x12, 96)
+BLKFLSBUF              _IO(0x12, 97)
+BLKRASET               _IO(0x12, 98)
+BLKRAGET               _IO(0x12, 99)
+BLKFRASET              _IO(0x12, 100)
+BLKFRAGET              _IO(0x12, 101)
+BLKSECTSET             _IO(0x12, 102)
+BLKSECTGET             _IO(0x12, 103)
+BLKSSZGET              _IO(0x12, 104)
+BLKPG                  _IO(0x12, 105)
+BLKELVGET              _IOR(0x12, 106, size_t)
+BLKELVSET              _IOW(0x12, 107, size_t)
+BLKBSZGET              _IOR(0x12, 112, size_t)
+BLKBSZSET              _IOW(0x12, 113, size_t)
+BLKGETSIZE64           _IOR(0x12, 114, size_t)
+BLKTRACESETUP          _IOWR(0x12, 115, struct blk_user_trace_setup)
+BLKTRACESTART          _IO(0x12, 116)
+BLKTRACESTOP           _IO(0x12, 117)
+BLKTRACETEARDOWN       _IO(0x12, 118)
+BLKDISCARD             _IO(0x12, 119)
+BLKIOMIN               _IO(0x12, 120)
+BLKIOOPT               _IO(0x12, 121)
+BLKALIGNOFF            _IO(0x12, 122)
+BLKPBSZGET             _IO(0x12, 123)
+BLKDISCARDZEROES       _IO(0x12, 124)
+BLKSECDISCARD          _IO(0x12, 125)
+BLKROTATIONAL          _IO(0x12, 126)
+BLKZEROOUT             _IO(0x12, 127)
+/* BLKDAXSET was present between v4.5-rc1~112^2^2~16 and v4.5-rc3~23^2~3 */
+/* BLKDAXSET           _IO(0x12, 128) */
+/* BLKDAXGET was present between v4.5-rc1~112^2^2~16 and v4.7-rc1~78^2^2~4 */
+BLKDAXGET              _IO(0x12, 129)