• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /* Generated by ./xlat/gen.sh from ./xlat/nbd_ioctl_flags.in; do not edit. */
2 
3 #include "gcc_compat.h"
4 #include "static_assert.h"
5 
6 #if defined(NBD_FLAG_HAS_FLAGS) || (defined(HAVE_DECL_NBD_FLAG_HAS_FLAGS) && HAVE_DECL_NBD_FLAG_HAS_FLAGS)
7 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
8 static_assert((NBD_FLAG_HAS_FLAGS) == ((1 << 0)), "NBD_FLAG_HAS_FLAGS != (1 << 0)");
9 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
10 #else
11 # define NBD_FLAG_HAS_FLAGS (1 << 0)
12 #endif
13 #if defined(NBD_FLAG_READ_ONLY) || (defined(HAVE_DECL_NBD_FLAG_READ_ONLY) && HAVE_DECL_NBD_FLAG_READ_ONLY)
14 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
15 static_assert((NBD_FLAG_READ_ONLY) == ((1 << 1)), "NBD_FLAG_READ_ONLY != (1 << 1)");
16 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
17 #else
18 # define NBD_FLAG_READ_ONLY (1 << 1)
19 #endif
20 #if defined(NBD_FLAG_SEND_FLUSH) || (defined(HAVE_DECL_NBD_FLAG_SEND_FLUSH) && HAVE_DECL_NBD_FLAG_SEND_FLUSH)
21 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
22 static_assert((NBD_FLAG_SEND_FLUSH) == ((1 << 2)), "NBD_FLAG_SEND_FLUSH != (1 << 2)");
23 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
24 #else
25 # define NBD_FLAG_SEND_FLUSH (1 << 2)
26 #endif
27 #if defined(NBD_FLAG_SEND_FUA) || (defined(HAVE_DECL_NBD_FLAG_SEND_FUA) && HAVE_DECL_NBD_FLAG_SEND_FUA)
28 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
29 static_assert((NBD_FLAG_SEND_FUA) == ((1 << 3)), "NBD_FLAG_SEND_FUA != (1 << 3)");
30 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
31 #else
32 # define NBD_FLAG_SEND_FUA (1 << 3)
33 #endif
34 #if defined(NBD_FLAG_ROTATIONAL) || (defined(HAVE_DECL_NBD_FLAG_ROTATIONAL) && HAVE_DECL_NBD_FLAG_ROTATIONAL)
35 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
36 static_assert((NBD_FLAG_ROTATIONAL) == ((1 << 4)), "NBD_FLAG_ROTATIONAL != (1 << 4)");
37 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
38 #else
39 # define NBD_FLAG_ROTATIONAL (1 << 4)
40 #endif
41 #if defined(NBD_FLAG_SEND_TRIM) || (defined(HAVE_DECL_NBD_FLAG_SEND_TRIM) && HAVE_DECL_NBD_FLAG_SEND_TRIM)
42 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
43 static_assert((NBD_FLAG_SEND_TRIM) == ((1 << 5)), "NBD_FLAG_SEND_TRIM != (1 << 5)");
44 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
45 #else
46 # define NBD_FLAG_SEND_TRIM (1 << 5)
47 #endif
48 #if defined(NBD_FLAG_SEND_WRITE_ZEROES) || (defined(HAVE_DECL_NBD_FLAG_SEND_WRITE_ZEROES) && HAVE_DECL_NBD_FLAG_SEND_WRITE_ZEROES)
49 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
50 static_assert((NBD_FLAG_SEND_WRITE_ZEROES) == ((1 << 6)), "NBD_FLAG_SEND_WRITE_ZEROES != (1 << 6)");
51 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
52 #else
53 # define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6)
54 #endif
55 #if defined(NBD_FLAG_SEND_DF) || (defined(HAVE_DECL_NBD_FLAG_SEND_DF) && HAVE_DECL_NBD_FLAG_SEND_DF)
56 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
57 static_assert((NBD_FLAG_SEND_DF) == ((1 << 7)), "NBD_FLAG_SEND_DF != (1 << 7)");
58 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
59 #else
60 # define NBD_FLAG_SEND_DF (1 << 7)
61 #endif
62 #if defined(NBD_FLAG_CAN_MULTI_CONN) || (defined(HAVE_DECL_NBD_FLAG_CAN_MULTI_CONN) && HAVE_DECL_NBD_FLAG_CAN_MULTI_CONN)
63 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
64 static_assert((NBD_FLAG_CAN_MULTI_CONN) == ((1 << 8)), "NBD_FLAG_CAN_MULTI_CONN != (1 << 8)");
65 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
66 #else
67 # define NBD_FLAG_CAN_MULTI_CONN (1 << 8)
68 #endif
69 #if defined(NBD_FLAG_SEND_RESIZE) || (defined(HAVE_DECL_NBD_FLAG_SEND_RESIZE) && HAVE_DECL_NBD_FLAG_SEND_RESIZE)
70 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
71 static_assert((NBD_FLAG_SEND_RESIZE) == ((1 << 9)), "NBD_FLAG_SEND_RESIZE != (1 << 9)");
72 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
73 #else
74 # define NBD_FLAG_SEND_RESIZE (1 << 9)
75 #endif
76 #if defined(NBD_FLAG_SEND_CACHE) || (defined(HAVE_DECL_NBD_FLAG_SEND_CACHE) && HAVE_DECL_NBD_FLAG_SEND_CACHE)
77 DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
78 static_assert((NBD_FLAG_SEND_CACHE) == ((1 << 10)), "NBD_FLAG_SEND_CACHE != (1 << 10)");
79 DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
80 #else
81 # define NBD_FLAG_SEND_CACHE (1 << 10)
82 #endif
83 
84 #ifndef XLAT_MACROS_ONLY
85 
86 # ifdef IN_MPERS
87 
88 #  error static const struct xlat nbd_ioctl_flags in mpers mode
89 
90 # else
91 
92 static
93 const struct xlat nbd_ioctl_flags[] = {
94 /*
95 * Some flags are not defined in <linux/nbd.h>, but are passed anyway.
96 * These flags are sent from nbd-server to the client, and the client
97 * passes them to the kernel unmodified after parsing. Both the client
98 * and the kernel ignore flags unknown to them.
99 */
100 
101 
102  XLAT(NBD_FLAG_HAS_FLAGS),
103 
104  XLAT(NBD_FLAG_READ_ONLY),
105 
106  XLAT(NBD_FLAG_SEND_FLUSH),
107 
108  XLAT(NBD_FLAG_SEND_FUA),
109 
110  XLAT(NBD_FLAG_ROTATIONAL),
111 
112  XLAT(NBD_FLAG_SEND_TRIM),
113 
114  XLAT(NBD_FLAG_SEND_WRITE_ZEROES),
115 
116  XLAT(NBD_FLAG_SEND_DF),
117 
118  XLAT(NBD_FLAG_CAN_MULTI_CONN),
119 
120  XLAT(NBD_FLAG_SEND_RESIZE),
121 
122  XLAT(NBD_FLAG_SEND_CACHE),
123  XLAT_END
124 };
125 
126 # endif /* !IN_MPERS */
127 
128 #endif /* !XLAT_MACROS_ONLY */
129