@@ -127,18 +127,32 @@ typedef struct NBDExtent {
127
127
128
128
/* Transmission (export) flags: sent from server to client during handshake,
129
129
but describe what will happen during transmission */
130
- #define NBD_FLAG_HAS_FLAGS (1 << 0) /* Flags are there */
131
- #define NBD_FLAG_READ_ONLY (1 << 1) /* Device is read-only */
132
- #define NBD_FLAG_SEND_FLUSH (1 << 2) /* Send FLUSH */
133
- #define NBD_FLAG_SEND_FUA (1 << 3) /* Send FUA (Force Unit Access) */
134
- #define NBD_FLAG_ROTATIONAL (1 << 4) /* Use elevator algorithm -
135
- rotational media */
136
- #define NBD_FLAG_SEND_TRIM (1 << 5) /* Send TRIM (discard) */
137
- #define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6) /* Send WRITE_ZEROES */
138
- #define NBD_FLAG_SEND_DF (1 << 7) /* Send DF (Do not Fragment) */
139
- #define NBD_FLAG_CAN_MULTI_CONN (1 << 8) /* Multi-client cache consistent */
140
- #define NBD_FLAG_SEND_RESIZE (1 << 9) /* Send resize */
141
- #define NBD_FLAG_SEND_CACHE (1 << 10) /* Send CACHE (prefetch) */
130
+ enum {
131
+ NBD_FLAG_HAS_FLAGS_BIT = 0 , /* Flags are there */
132
+ NBD_FLAG_READ_ONLY_BIT = 1 , /* Device is read-only */
133
+ NBD_FLAG_SEND_FLUSH_BIT = 2 , /* Send FLUSH */
134
+ NBD_FLAG_SEND_FUA_BIT = 3 , /* Send FUA (Force Unit Access) */
135
+ NBD_FLAG_ROTATIONAL_BIT = 4 , /* Use elevator algorithm -
136
+ rotational media */
137
+ NBD_FLAG_SEND_TRIM_BIT = 5 , /* Send TRIM (discard) */
138
+ NBD_FLAG_SEND_WRITE_ZEROES_BIT = 6 , /* Send WRITE_ZEROES */
139
+ NBD_FLAG_SEND_DF_BIT = 7 , /* Send DF (Do not Fragment) */
140
+ NBD_FLAG_CAN_MULTI_CONN_BIT = 8 , /* Multi-client cache consistent */
141
+ NBD_FLAG_SEND_RESIZE_BIT = 9 , /* Send resize */
142
+ NBD_FLAG_SEND_CACHE_BIT = 10 , /* Send CACHE (prefetch) */
143
+ };
144
+
145
+ #define NBD_FLAG_HAS_FLAGS (1 << NBD_FLAG_HAS_FLAGS_BIT)
146
+ #define NBD_FLAG_READ_ONLY (1 << NBD_FLAG_READ_ONLY_BIT)
147
+ #define NBD_FLAG_SEND_FLUSH (1 << NBD_FLAG_SEND_FLUSH_BIT)
148
+ #define NBD_FLAG_SEND_FUA (1 << NBD_FLAG_SEND_FUA_BIT)
149
+ #define NBD_FLAG_ROTATIONAL (1 << NBD_FLAG_ROTATIONAL_BIT)
150
+ #define NBD_FLAG_SEND_TRIM (1 << NBD_FLAG_SEND_TRIM_BIT)
151
+ #define NBD_FLAG_SEND_WRITE_ZEROES (1 << NBD_FLAG_SEND_WRITE_ZEROES_BIT)
152
+ #define NBD_FLAG_SEND_DF (1 << NBD_FLAG_SEND_DF_BIT)
153
+ #define NBD_FLAG_CAN_MULTI_CONN (1 << NBD_FLAG_CAN_MULTI_CONN_BIT)
154
+ #define NBD_FLAG_SEND_RESIZE (1 << NBD_FLAG_SEND_RESIZE_BIT)
155
+ #define NBD_FLAG_SEND_CACHE (1 << NBD_FLAG_SEND_CACHE_BIT)
142
156
143
157
/* New-style handshake (global) flags, sent from server to client, and
144
158
control what will happen during handshake phase. */
0 commit comments