staging: lustre: lnet: change lnet_magicversion_t to proper structure
authorJames Simmons <jsimmons@infradead.org>
Sun, 22 Jan 2017 00:40:30 +0000 (19:40 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 23 Jan 2017 08:59:04 +0000 (09:59 +0100)
Change lnet_magicversion_t from typedef to proper structure.

Signed-off-by: James Simmons <uja.ornl@yahoo.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6142
Reviewed-on: https://review.whamcloud.com/24566
Reviewed-by: Doug Oucharek <doug.s.oucharek@intel.com>
Reviewed-by: Olaf Weber <olaf@sgi.com>
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Dmitry Eremin <dmitry.eremin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/lustre/include/linux/lnet/types.h
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
drivers/staging/lustre/lnet/lnet/api-ni.c

index c14015a..a6233be 100644 (file)
@@ -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
index 972f609..42b67b0 100644 (file)
@@ -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) &&
index 8f0ff6c..420597b 100644 (file)
@@ -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)
index 3b2488f..fd4153b 100644 (file)
@@ -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);