Commit 5f991c4c authored by James Simmons's avatar James Simmons Committed by Greg Kroah-Hartman

staging: lustre: lnet: change lnet_magicversion_t to proper structure

Change lnet_magicversion_t from typedef to proper structure.
Signed-off-by: default avatarJames Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566Reviewed-by: default avatarDoug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: default avatarOlaf Weber <olaf@sgi.com>
Reviewed-by: default avatarAndreas Dilger <andreas.dilger@intel.com>
Reviewed-by: default avatarDmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: default avatarJames Simmons <jsimmons@infradead.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9fbf9201
......@@ -204,11 +204,11 @@ typedef struct {
* exchange HELLO messages when a connection is first established. Individual
* LNDs can put whatever else they fancy in lnet_hdr_t::msg.
*/
typedef struct {
struct lnet_magicversion {
__u32 magic; /* LNET_PROTO_TCP_MAGIC */
__u16 version_major; /* increment on incompatible change */
__u16 version_minor; /* increment on compatible change */
} WIRE_ATTR lnet_magicversion_t;
} WIRE_ATTR;
/* PROTO MAGIC for LNDs */
#define LNET_PROTO_IB_MAGIC 0x0be91b91
......
......@@ -1656,9 +1656,9 @@ ksocknal_parse_proto_version(ksock_hello_msg_t *hello)
}
if (hello->kshm_magic == le32_to_cpu(LNET_PROTO_TCP_MAGIC)) {
lnet_magicversion_t *hmv = (lnet_magicversion_t *)hello;
struct lnet_magicversion *hmv = (struct lnet_magicversion *)hello;
CLASSERT(sizeof(lnet_magicversion_t) ==
CLASSERT(sizeof(struct lnet_magicversion) ==
offsetof(ksock_hello_msg_t, kshm_src_nid));
if (hmv->version_major == cpu_to_le16(KSOCK_PROTO_V1_MAJOR) &&
......
......@@ -460,11 +460,11 @@ ksocknal_send_hello_v1(struct ksock_conn *conn, ksock_hello_msg_t *hello)
{
struct socket *sock = conn->ksnc_sock;
lnet_hdr_t *hdr;
lnet_magicversion_t *hmv;
struct lnet_magicversion *hmv;
int rc;
int i;
CLASSERT(sizeof(lnet_magicversion_t) == offsetof(lnet_hdr_t, src_nid));
CLASSERT(sizeof(struct lnet_magicversion) == offsetof(lnet_hdr_t, src_nid));
LIBCFS_ALLOC(hdr, sizeof(*hdr));
if (!hdr) {
......@@ -472,7 +472,7 @@ ksocknal_send_hello_v1(struct ksock_conn *conn, ksock_hello_msg_t *hello)
return -ENOMEM;
}
hmv = (lnet_magicversion_t *)&hdr->dest_nid;
hmv = (struct lnet_magicversion *)&hdr->dest_nid;
/*
* Re-organize V2.x message header to V1.x (lnet_hdr_t)
......
......@@ -196,14 +196,14 @@ static void lnet_assert_wire_constants(void)
CLASSERT((int)offsetof(struct lnet_handle_wire, wh_object_cookie) == 8);
CLASSERT((int)sizeof(((struct lnet_handle_wire *)0)->wh_object_cookie) == 8);
/* Checks for struct lnet_magicversion_t */
CLASSERT((int)sizeof(lnet_magicversion_t) == 8);
CLASSERT((int)offsetof(lnet_magicversion_t, magic) == 0);
CLASSERT((int)sizeof(((lnet_magicversion_t *)0)->magic) == 4);
CLASSERT((int)offsetof(lnet_magicversion_t, version_major) == 4);
CLASSERT((int)sizeof(((lnet_magicversion_t *)0)->version_major) == 2);
CLASSERT((int)offsetof(lnet_magicversion_t, version_minor) == 6);
CLASSERT((int)sizeof(((lnet_magicversion_t *)0)->version_minor) == 2);
/* Checks for struct struct lnet_magicversion */
CLASSERT((int)sizeof(struct lnet_magicversion) == 8);
CLASSERT((int)offsetof(struct lnet_magicversion, magic) == 0);
CLASSERT((int)sizeof(((struct lnet_magicversion *)0)->magic) == 4);
CLASSERT((int)offsetof(struct lnet_magicversion, version_major) == 4);
CLASSERT((int)sizeof(((struct lnet_magicversion *)0)->version_major) == 2);
CLASSERT((int)offsetof(struct lnet_magicversion, version_minor) == 6);
CLASSERT((int)sizeof(((struct lnet_magicversion *)0)->version_minor) == 2);
/* Checks for struct lnet_hdr_t */
CLASSERT((int)sizeof(lnet_hdr_t) == 72);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment