From: Eugene Syromyatnikov Date: Sun, 17 Sep 2017 01:51:51 +0000 (+0200) Subject: dm: add support for DM_DEV_ARM_POLL X-Git-Tag: v4.20~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6769418d51bcdee8869fe5796d7228b74befcc27;p=strace dm: add support for DM_DEV_ARM_POLL Added in Linux commit v4.13-rc1~137^2~14. * dm.c [!DM_LIST_VERSIONS] (DM_LIST_VERSIONS): Add leading zero. [!DM_TARGET_MSG] (DM_TARGET_MSG): Likewise. [!DM_DEV_SET_GEOMETRY_CMD] (DM_DEV_SET_GEOMETRY_CMD): Likewise. [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro. (dm_ioctl_has_params, dm_ioctl): Handle DM_DEV_ARM_POLL. * tests/ioctl_dm.c [!DM_DEV_ARM_POLL] (DM_DEV_ARM_POLL): New macro. (main) : Add DM_DEV_ARM_POLL. --- diff --git a/dm.c b/dm.c index 55efd92b..28863a87 100644 --- a/dm.c +++ b/dm.c @@ -44,13 +44,16 @@ /* Definitions for command which have been added later */ # ifndef DM_LIST_VERSIONS -# define DM_LIST_VERSIONS _IOWR(DM_IOCTL, 0xd, struct dm_ioctl) +# define DM_LIST_VERSIONS _IOWR(DM_IOCTL, 0x0d, struct dm_ioctl) # endif # ifndef DM_TARGET_MSG -# define DM_TARGET_MSG _IOWR(DM_IOCTL, 0xe, struct dm_ioctl) +# define DM_TARGET_MSG _IOWR(DM_IOCTL, 0x0e, struct dm_ioctl) # endif # ifndef DM_DEV_SET_GEOMETRY -# define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, 0xf, struct dm_ioctl) +# define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, 0x0f, struct dm_ioctl) +# endif +# ifndef DM_DEV_ARM_POLL +# define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, 0x10, struct dm_ioctl) # endif @@ -429,6 +432,7 @@ dm_ioctl_has_params(const unsigned int code) case DM_DEV_SUSPEND: case DM_DEV_STATUS: case DM_TABLE_CLEAR: + case DM_DEV_ARM_POLL: return false; } @@ -576,6 +580,7 @@ dm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t ar case DM_LIST_VERSIONS: case DM_TARGET_MSG: case DM_DEV_SET_GEOMETRY: + case DM_DEV_ARM_POLL: return dm_known_ioctl(tcp, code, arg); default: return RVAL_DECODED; diff --git a/tests/ioctl_dm.c b/tests/ioctl_dm.c index 2f77e041..1e831dfe 100644 --- a/tests/ioctl_dm.c +++ b/tests/ioctl_dm.c @@ -54,6 +54,10 @@ # define ALIGNED_OFFSET(t_, m_) \ ALIGNED_SIZE(offsetof(t_, m_), t_) +# ifndef DM_DEV_ARM_POLL +# define DM_DEV_ARM_POLL _IOWR(DM_IOCTL, 0x10, struct dm_ioctl) +# endif + static const char str129[] = STR32 STR32 STR32 STR32 "6"; static const __u64 dts_sector_base = (__u64) 0xdeadca75facef157ULL; @@ -182,6 +186,7 @@ main(void) { ARG_STR(DM_TABLE_CLEAR), false }, { ARG_STR(DM_TABLE_DEPS), true }, { ARG_STR(DM_TABLE_STATUS), true }, + { ARG_STR(DM_DEV_ARM_POLL), false }, }; struct dm_ioctl *unaligned_dm_arg =