1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 3 * Display helpers for generic filesystem item 4 * 5 * Author: Chuck Lever <chuck.lever@oracle.com 6 * 7 * Copyright (c) 2020, Oracle and/or its affil 8 */ 9 10 #include <linux/fs.h> 11 12 #define show_fs_dirent_type(x) \ 13 __print_symbolic(x, \ 14 { DT_UNKNOWN, "UNKNO 15 { DT_FIFO, "FIFO" 16 { DT_CHR, "CHR" 17 { DT_DIR, "DIR" 18 { DT_BLK, "BLK" 19 { DT_REG, "REG" 20 { DT_LNK, "LNK" 21 { DT_SOCK, "SOCK" 22 { DT_WHT, "WHT" 23 24 #define show_fs_fcntl_open_flags(x) \ 25 __print_flags(x, "|", \ 26 { O_WRONLY, "O_WRO 27 { O_RDWR, "O_RDW 28 { O_CREAT, "O_CRE 29 { O_EXCL, "O_EXC 30 { O_NOCTTY, "O_NOC 31 { O_TRUNC, "O_TRU 32 { O_APPEND, "O_APP 33 { O_NONBLOCK, "O_NON 34 { O_DSYNC, "O_DSY 35 { O_DIRECT, "O_DIR 36 { O_LARGEFILE, "O_LAR 37 { O_DIRECTORY, "O_DIR 38 { O_NOFOLLOW, "O_NOF 39 { O_NOATIME, "O_NOA 40 { O_CLOEXEC, "O_CLO 41 42 #define __fmode_flag(x) { (__force unsigned lo 43 #define show_fs_fmode_flags(x) \ 44 __print_flags(x, "|", \ 45 __fmode_flag(READ), \ 46 __fmode_flag(WRITE), \ 47 __fmode_flag(EXEC)) 48 49 #ifdef CONFIG_64BIT 50 #define show_fs_fcntl_cmd(x) \ 51 __print_symbolic(x, \ 52 { F_DUPFD, "DUPFD 53 { F_GETFD, "GETFD 54 { F_SETFD, "SETFD 55 { F_GETFL, "GETFL 56 { F_SETFL, "SETFL 57 { F_GETLK, "GETLK 58 { F_SETLK, "SETLK 59 { F_SETLKW, "SETLK 60 { F_SETOWN, "SETOW 61 { F_GETOWN, "GETOW 62 { F_SETSIG, "SETSI 63 { F_GETSIG, "GETSI 64 { F_SETOWN_EX, "SETOW 65 { F_GETOWN_EX, "GETOW 66 { F_GETOWNER_UIDS, "GETOW 67 { F_OFD_GETLK, "OFD_G 68 { F_OFD_SETLK, "OFD_S 69 { F_OFD_SETLKW, "OFD_S 70 #else /* CONFIG_64BIT */ 71 #define show_fs_fcntl_cmd(x) \ 72 __print_symbolic(x, \ 73 { F_DUPFD, "DUPFD 74 { F_GETFD, "GETFD 75 { F_SETFD, "SETFD 76 { F_GETFL, "GETFL 77 { F_SETFL, "SETFL 78 { F_GETLK, "GETLK 79 { F_SETLK, "SETLK 80 { F_SETLKW, "SETLK 81 { F_SETOWN, "SETOW 82 { F_GETOWN, "GETOW 83 { F_SETSIG, "SETSI 84 { F_GETSIG, "GETSI 85 { F_GETLK64, "GETLK 86 { F_SETLK64, "SETLK 87 { F_SETLKW64, "SETLK 88 { F_SETOWN_EX, "SETOW 89 { F_GETOWN_EX, "GETOW 90 { F_GETOWNER_UIDS, "GETOW 91 { F_OFD_GETLK, "OFD_G 92 { F_OFD_SETLK, "OFD_S 93 { F_OFD_SETLKW, "OFD_S 94 #endif /* CONFIG_64BIT */ 95 96 #define show_fs_fcntl_lock_type(x) \ 97 __print_symbolic(x, \ 98 { F_RDLCK, "RDLCK 99 { F_WRLCK, "WRLCK 100 { F_UNLCK, "UNLCK 101 102 #define show_fs_lookup_flags(flags) \ 103 __print_flags(flags, "|", \ 104 { LOOKUP_FOLLOW, "FOLLO 105 { LOOKUP_DIRECTORY, "DIREC 106 { LOOKUP_AUTOMOUNT, "AUTOM 107 { LOOKUP_EMPTY, "EMPTY 108 { LOOKUP_DOWN, "DOWN" 109 { LOOKUP_MOUNTPOINT, "MOUNT 110 { LOOKUP_REVAL, "REVAL 111 { LOOKUP_RCU, "RCU" 112 { LOOKUP_OPEN, "OPEN" 113 { LOOKUP_CREATE, "CREAT 114 { LOOKUP_EXCL, "EXCL" 115 { LOOKUP_RENAME_TARGET, "RENAM 116 { LOOKUP_PARENT, "PAREN 117 { LOOKUP_NO_SYMLINKS, "NO_SY 118 { LOOKUP_NO_MAGICLINKS, "NO_MA 119 { LOOKUP_NO_XDEV, "NO_XD 120 { LOOKUP_BENEATH, "BENEA 121 { LOOKUP_IN_ROOT, "IN_RO 122 { LOOKUP_CACHED, "CACHE 123
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.