__u64 imp_connect_flags2_orig;
int imp_connect_error;
- __u32 imp_msg_magic;
- /* adjusted based on server capability */
- __u32 imp_msghdr_flags;
+ enum lustre_msg_magic imp_msg_magic;
+ /* adjusted based on server capability */
+ enum lustre_msghdr imp_msghdr_flags;
- /* adaptive timeout data */
- struct imp_at imp_at;
- time64_t imp_last_reply_time; /* for health check */
+ /* adaptive timeout data */
+ struct imp_at imp_at;
+ time64_t imp_last_reply_time; /* for health check */
};
/* import.c */
};
/* lustre_msg struct magic. DON'T use swabbed values of MAGIC as magic! */
-#define LUSTRE_MSG_MAGIC_V2 0x0BD00BD3
-#define LUSTRE_MSG_MAGIC_V2_SWABBED 0xD30BD00B
-#define LUSTRE_MSG_MAGIC LUSTRE_MSG_MAGIC_V2
+enum lustre_msg_magic {
+ LUSTRE_MSG_MAGIC_V2 = 0x0BD00BD3,
+ LUSTRE_MSG_MAGIC_V2_SWABBED = 0xD30BD00B,
+ LUSTRE_MSG_MAGIC = LUSTRE_MSG_MAGIC_V2
+};
/* flags for lm_flags */
-#define MSGHDR_AT_SUPPORT 0x1 /* adaptive timeouts, lm_cksum valid
+enum lustre_msghdr {
+ MSGHDR_AT_SUPPORT = 0x1, /* adaptive timeouts, lm_cksum valid
* in early reply messages */
-#define MSGHDR_CKSUM_INCOMPAT18 0x2 /* compat for 1.8, needs to be set well
+ MSGHDR_CKSUM_INCOMPAT18 = 0x2, /* compat for 1.8, needs to be set well
* beyond 2.8.0 for compatibility */
+};
+
#define lustre_msg lustre_msg_v2
/* we depend on this structure to be 8-byte aligned */
/* this type is only endian-adjusted in lustre_unpack_msg() */
__u32 lm_magic; /* RPC version magic = LUSTRE_MSG_MAGIC_V2 */
__u32 lm_repsize; /* size of preallocated reply buffer */
__u32 lm_cksum; /* CRC32 of ptlrpc_body early reply messages */
- __u32 lm_flags; /* MSGHDR_* flags */
+ __u32 lm_flags; /* enum lustre_msghdr MSGHDR_* flags */
__u32 lm_padding_2; /* unused */
__u32 lm_padding_3; /* unused */
__u32 lm_buflens[0]; /* length of additional buffers in bytes,
#define PTL_RPC_MSG_REPLY 4713 /* normal RPC reply message */
/* ptlrpc_body pb_version ((target_version << 16) | rpc_version) */
-#define PTLRPC_MSG_VERSION 0x00000003
-#define LUSTRE_VERSION_MASK 0xffff0000
-#define LUSTRE_OBD_VERSION 0x00010000
-#define LUSTRE_MDS_VERSION 0x00020000
-#define LUSTRE_OST_VERSION 0x00030000
-#define LUSTRE_DLM_VERSION 0x00040000
-#define LUSTRE_LOG_VERSION 0x00050000
-#define LUSTRE_MGS_VERSION 0x00060000
+enum lustre_msg_version {
+ PTLRPC_MSG_VERSION = 0x00000003,
+ LUSTRE_VERSION_MASK = 0xffff0000,
+ LUSTRE_OBD_VERSION = 0x00010000,
+ LUSTRE_MDS_VERSION = 0x00020000,
+ LUSTRE_OST_VERSION = 0x00030000,
+ LUSTRE_DLM_VERSION = 0x00040000,
+ LUSTRE_LOG_VERSION = 0x00050000,
+ LUSTRE_MGS_VERSION = 0x00060000,
+};
/* pb_flags that apply to all request messages */
/* #define MSG_LAST_REPLAY 0x0001 obsolete 2.0 => {REQ,LOCK}_REPLAY_DONE */
}
static inline int lustre_msg_check_version_v2(struct lustre_msg_v2 *msg,
- __u32 version)
+ enum lustre_msg_version version)
{
- __u32 ver = lustre_msg_get_version(msg);
- return (ver & LUSTRE_VERSION_MASK) != version;
+ enum lustre_msg_version ver = lustre_msg_get_version(msg);
+
+ return (ver & LUSTRE_VERSION_MASK) != version;
}
-int lustre_msg_check_version(struct lustre_msg *msg, __u32 version)
+int lustre_msg_check_version(struct lustre_msg *msg,
+ enum lustre_msg_version version)
{
#define LUSTRE_MSG_MAGIC_V1 0x0BD00BD0
switch (msg->lm_magic) {
sizeof(struct ptlrpc_body_v2));
}
-__u32 lustre_msghdr_get_flags(struct lustre_msg *msg)
+enum lustre_msghdr lustre_msghdr_get_flags(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
case LUSTRE_MSG_MAGIC_V2:
}
EXPORT_SYMBOL(lustre_msg_get_type);
-__u32 lustre_msg_get_version(struct lustre_msg *msg)
+enum lustre_msg_version lustre_msg_get_version(struct lustre_msg *msg)
{
switch (msg->lm_magic) {
case LUSTRE_MSG_MAGIC_V2: {