Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 1 | #include "defs.h" |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 2 | |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 3 | #include "xlat/fan_classes.h" |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 4 | #include "xlat/fan_init_flags.h" |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 5 | |
Dmitry V. Levin | 34bbcc6 | 2015-02-19 21:55:09 +0000 | [diff] [blame] | 6 | #ifndef FAN_ALL_CLASS_BITS |
| 7 | # define FAN_ALL_CLASS_BITS (FAN_CLASS_NOTIF | FAN_CLASS_CONTENT | FAN_CLASS_PRE_CONTENT) |
| 8 | #endif |
| 9 | #ifndef FAN_NOFD |
| 10 | # define FAN_NOFD -1 |
| 11 | #endif |
| 12 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 13 | SYS_FUNC(fanotify_init) |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 14 | { |
| 15 | unsigned flags; |
| 16 | |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 17 | flags = tcp->u_arg[0]; |
| 18 | printxval(fan_classes, flags & FAN_ALL_CLASS_BITS, "FAN_CLASS_???"); |
| 19 | flags &= ~FAN_ALL_CLASS_BITS; |
| 20 | if (flags) { |
| 21 | tprints("|"); |
| 22 | printflags(fan_init_flags, flags, "FAN_???"); |
| 23 | } |
| 24 | tprints(", "); |
| 25 | tprint_open_modes((unsigned) tcp->u_arg[1]); |
| 26 | |
Dmitry V. Levin | 5d22f07 | 2015-08-02 01:31:40 +0000 | [diff] [blame] | 27 | return RVAL_DECODED | RVAL_FD; |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 28 | } |
| 29 | |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 30 | #include "xlat/fan_mark_flags.h" |
Dmitry V. Levin | 0ed617b | 2014-04-25 23:30:54 +0000 | [diff] [blame] | 31 | #include "xlat/fan_event_flags.h" |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 32 | |
Dmitry V. Levin | a0bd374 | 2015-04-07 01:36:50 +0000 | [diff] [blame] | 33 | SYS_FUNC(fanotify_mark) |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 34 | { |
Dmitry V. Levin | 1ea6473 | 2015-01-10 00:08:58 +0000 | [diff] [blame] | 35 | unsigned long long mask = 0; |
| 36 | int argn; |
| 37 | |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 38 | printfd(tcp, tcp->u_arg[0]); |
| 39 | tprints(", "); |
| 40 | printflags(fan_mark_flags, (unsigned) tcp->u_arg[1], "FAN_MARK_???"); |
| 41 | tprints(", "); |
Dmitry V. Levin | 1ea6473 | 2015-01-10 00:08:58 +0000 | [diff] [blame] | 42 | /* |
| 43 | * the mask argument is defined as 64-bit, |
| 44 | * but kernel uses the lower 32 bits only. |
| 45 | */ |
| 46 | argn = getllval(tcp, &mask, 2); |
Mike Frysinger | 28e3d6f | 2015-02-26 14:16:13 -0500 | [diff] [blame] | 47 | #ifdef HPPA |
| 48 | /* Parsic is weird. See arch/parisc/kernel/sys_parisc32.c. */ |
| 49 | mask = (mask << 32) | (mask >> 32); |
| 50 | #endif |
Dmitry V. Levin | 1ea6473 | 2015-01-10 00:08:58 +0000 | [diff] [blame] | 51 | printflags(fan_event_flags, mask, "FAN_???"); |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 52 | tprints(", "); |
Dmitry V. Levin | 1ea6473 | 2015-01-10 00:08:58 +0000 | [diff] [blame] | 53 | if ((int) tcp->u_arg[argn] == FAN_NOFD) |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 54 | tprints("FAN_NOFD, "); |
| 55 | else |
Dmitry V. Levin | 1ea6473 | 2015-01-10 00:08:58 +0000 | [diff] [blame] | 56 | print_dirfd(tcp, tcp->u_arg[argn]); |
| 57 | printpath(tcp, tcp->u_arg[argn + 1]); |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 58 | |
Dmitry V. Levin | a3a7ffe | 2015-07-20 13:58:09 +0000 | [diff] [blame] | 59 | return RVAL_DECODED; |
Dmitry V. Levin | 99db95d | 2014-02-05 04:13:18 +0000 | [diff] [blame] | 60 | } |