C++程序  |  129行  |  4.43 KB

/* Generated by ./xlat/gen.sh from ./xlat/nbd_ioctl_flags.in; do not edit. */

#include "gcc_compat.h"
#include "static_assert.h"

#if defined(NBD_FLAG_HAS_FLAGS) || (defined(HAVE_DECL_NBD_FLAG_HAS_FLAGS) && HAVE_DECL_NBD_FLAG_HAS_FLAGS)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_HAS_FLAGS) == ((1 << 0)), "NBD_FLAG_HAS_FLAGS != (1 << 0)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_HAS_FLAGS (1 << 0)
#endif
#if defined(NBD_FLAG_READ_ONLY) || (defined(HAVE_DECL_NBD_FLAG_READ_ONLY) && HAVE_DECL_NBD_FLAG_READ_ONLY)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_READ_ONLY) == ((1 << 1)), "NBD_FLAG_READ_ONLY != (1 << 1)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_READ_ONLY (1 << 1)
#endif
#if defined(NBD_FLAG_SEND_FLUSH) || (defined(HAVE_DECL_NBD_FLAG_SEND_FLUSH) && HAVE_DECL_NBD_FLAG_SEND_FLUSH)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_SEND_FLUSH) == ((1 << 2)), "NBD_FLAG_SEND_FLUSH != (1 << 2)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_SEND_FLUSH (1 << 2)
#endif
#if defined(NBD_FLAG_SEND_FUA) || (defined(HAVE_DECL_NBD_FLAG_SEND_FUA) && HAVE_DECL_NBD_FLAG_SEND_FUA)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_SEND_FUA) == ((1 << 3)), "NBD_FLAG_SEND_FUA != (1 << 3)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_SEND_FUA (1 << 3)
#endif
#if defined(NBD_FLAG_ROTATIONAL) || (defined(HAVE_DECL_NBD_FLAG_ROTATIONAL) && HAVE_DECL_NBD_FLAG_ROTATIONAL)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_ROTATIONAL) == ((1 << 4)), "NBD_FLAG_ROTATIONAL != (1 << 4)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_ROTATIONAL (1 << 4)
#endif
#if defined(NBD_FLAG_SEND_TRIM) || (defined(HAVE_DECL_NBD_FLAG_SEND_TRIM) && HAVE_DECL_NBD_FLAG_SEND_TRIM)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_SEND_TRIM) == ((1 << 5)), "NBD_FLAG_SEND_TRIM != (1 << 5)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_SEND_TRIM (1 << 5)
#endif
#if defined(NBD_FLAG_SEND_WRITE_ZEROES) || (defined(HAVE_DECL_NBD_FLAG_SEND_WRITE_ZEROES) && HAVE_DECL_NBD_FLAG_SEND_WRITE_ZEROES)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_SEND_WRITE_ZEROES) == ((1 << 6)), "NBD_FLAG_SEND_WRITE_ZEROES != (1 << 6)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_SEND_WRITE_ZEROES (1 << 6)
#endif
#if defined(NBD_FLAG_SEND_DF) || (defined(HAVE_DECL_NBD_FLAG_SEND_DF) && HAVE_DECL_NBD_FLAG_SEND_DF)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_SEND_DF) == ((1 << 7)), "NBD_FLAG_SEND_DF != (1 << 7)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_SEND_DF (1 << 7)
#endif
#if defined(NBD_FLAG_CAN_MULTI_CONN) || (defined(HAVE_DECL_NBD_FLAG_CAN_MULTI_CONN) && HAVE_DECL_NBD_FLAG_CAN_MULTI_CONN)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_CAN_MULTI_CONN) == ((1 << 8)), "NBD_FLAG_CAN_MULTI_CONN != (1 << 8)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_CAN_MULTI_CONN (1 << 8)
#endif
#if defined(NBD_FLAG_SEND_RESIZE) || (defined(HAVE_DECL_NBD_FLAG_SEND_RESIZE) && HAVE_DECL_NBD_FLAG_SEND_RESIZE)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_SEND_RESIZE) == ((1 << 9)), "NBD_FLAG_SEND_RESIZE != (1 << 9)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_SEND_RESIZE (1 << 9)
#endif
#if defined(NBD_FLAG_SEND_CACHE) || (defined(HAVE_DECL_NBD_FLAG_SEND_CACHE) && HAVE_DECL_NBD_FLAG_SEND_CACHE)
DIAG_PUSH_IGNORE_TAUTOLOGICAL_COMPARE
static_assert((NBD_FLAG_SEND_CACHE) == ((1 << 10)), "NBD_FLAG_SEND_CACHE != (1 << 10)");
DIAG_POP_IGNORE_TAUTOLOGICAL_COMPARE
#else
# define NBD_FLAG_SEND_CACHE (1 << 10)
#endif

#ifndef XLAT_MACROS_ONLY

# ifdef IN_MPERS

#  error static const struct xlat nbd_ioctl_flags in mpers mode

# else

static
const struct xlat nbd_ioctl_flags[] = {
/*
* Some flags are not defined in <linux/nbd.h>, but are passed anyway.
* These flags are sent from nbd-server to the client, and the client
* passes them to the kernel unmodified after parsing. Both the client
* and the kernel ignore flags unknown to them.
*/


 XLAT(NBD_FLAG_HAS_FLAGS),

 XLAT(NBD_FLAG_READ_ONLY),

 XLAT(NBD_FLAG_SEND_FLUSH),

 XLAT(NBD_FLAG_SEND_FUA),

 XLAT(NBD_FLAG_ROTATIONAL),

 XLAT(NBD_FLAG_SEND_TRIM),

 XLAT(NBD_FLAG_SEND_WRITE_ZEROES),

 XLAT(NBD_FLAG_SEND_DF),

 XLAT(NBD_FLAG_CAN_MULTI_CONN),

 XLAT(NBD_FLAG_SEND_RESIZE),

 XLAT(NBD_FLAG_SEND_CACHE),
 XLAT_END
};

# endif /* !IN_MPERS */

#endif /* !XLAT_MACROS_ONLY */