block: move fallback definitions for ioctl commands to xlat

* 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.
This commit is contained in:
Eugene Syromyatnikov 2018-08-25 22:02:35 +02:00 committed by Dmitry V. Levin
parent 9b5d56054c
commit 618d4ed497
2 changed files with 40 additions and 50 deletions

55
block.c
View File

@ -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

35
xlat/block_ioctl_cmds.in Normal file
View File

@ -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)