From: Eugene Syromyatnikov Date: Mon, 19 Dec 2016 00:11:18 +0000 (+0300) Subject: loop: add fallback definitions for LOOP_* ioctl command constants X-Git-Tag: v4.16~122 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a4ef4a796e8c89d6aea8ac3762795d82ba3362b8;p=strace loop: add fallback definitions for LOOP_* ioctl command constants Since these are architecture-independent and have been added over the kernel's lifetime, it makes sense to have these definitions in strace itself. * xlat/loop_cmds.in: New file. * loop.c: Include "xlat/loop_cmds.h". (loop_ioctl): Eliminate conditional compilation based on availability of LOOP_* constant definitions. --- diff --git a/loop.c b/loop.c index ebb518bc..2ade8e7a 100644 --- a/loop.c +++ b/loop.c @@ -35,6 +35,7 @@ typedef struct loop_info struct_loop_info; #include MPERS_DEFS +#include "xlat/loop_cmds.h" #include "xlat/loop_flags_options.h" #include "xlat/loop_crypt_type_options.h" @@ -173,13 +174,9 @@ MPERS_PRINTER_DECL(int, loop_ioctl, break; case LOOP_CLR_FD: -#ifdef LOOP_SET_CAPACITY case LOOP_SET_CAPACITY: -#endif -#ifdef LOOP_CTL_GET_FREE /* newer loop-control stuff */ case LOOP_CTL_GET_FREE: -#endif /* Takes no arguments */ break; @@ -189,19 +186,15 @@ MPERS_PRINTER_DECL(int, loop_ioctl, printfd(tcp, arg); break; -#ifdef LOOP_CTL_ADD /* newer loop-control stuff */ case LOOP_CTL_ADD: case LOOP_CTL_REMOVE: tprintf(", %d", (int) arg); break; -#endif -#ifdef LOOP_SET_DIRECT_IO case LOOP_SET_DIRECT_IO: tprintf(", %" PRI_klu, arg); break; -#endif default: return RVAL_DECODED; diff --git a/xlat/loop_cmds.in b/xlat/loop_cmds.in new file mode 100644 index 00000000..6faca515 --- /dev/null +++ b/xlat/loop_cmds.in @@ -0,0 +1,13 @@ +LOOP_SET_FD 0x4C00 +LOOP_CLR_FD 0x4C01 +LOOP_SET_STATUS 0x4C02 +LOOP_GET_STATUS 0x4C03 +LOOP_SET_STATUS64 0x4C04 +LOOP_GET_STATUS64 0x4C05 +LOOP_CHANGE_FD 0x4C06 +LOOP_SET_CAPACITY 0x4C07 +LOOP_SET_DIRECT_IO 0x4C08 +LOOP_CTL_ADD 0x4C80 +LOOP_CTL_REMOVE 0x4C81 +LOOP_CTL_GET_FREE 0x4C82 +#stop