From: James Simmons <jsimmons@infradead.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
devel@driverdev.osuosl.org,
Andreas Dilger <andreas.dilger@intel.com>,
Oleg Drokin <oleg.drokin@intel.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Lustre Development List <lustre-devel@lists.lustre.org>,
James Simmons <jsimmons@infradead.org>,
James Simmons <uja.ornl@yahoo.com>
Subject: [PATCH 6/8] staging: lustre: lnet: change lnet_magicversion_t to proper structure
Date: Sat, 21 Jan 2017 19:40:30 -0500 [thread overview]
Message-ID: <1485045632-5886-7-git-send-email-jsimmons@infradead.org> (raw)
In-Reply-To: <1485045632-5886-1-git-send-email-jsimmons@infradead.org>
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>
---
drivers/staging/lustre/include/linux/lnet/types.h | 4 ++--
drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c | 4 ++--
.../staging/lustre/lnet/klnds/socklnd/socklnd_proto.c | 6 +++---
drivers/staging/lustre/lnet/lnet/api-ni.c | 16 ++++++++--------
4 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/lnet/types.h b/drivers/staging/lustre/include/linux/lnet/types.h
index c14015a..a6233be 100644
--- a/drivers/staging/lustre/include/linux/lnet/types.h
+++ b/drivers/staging/lustre/include/linux/lnet/types.h
@@ -204,11 +204,11 @@ struct lnet_handle_wire {
* 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
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
index 972f609..42b67b0 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_cb.c
@@ -1656,9 +1656,9 @@ void ksocknal_write_callback(struct ksock_conn *conn)
}
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) &&
diff --git a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
index 8f0ff6c..420597b 100644
--- a/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
+++ b/drivers/staging/lustre/lnet/klnds/socklnd/socklnd_proto.c
@@ -460,11 +460,11 @@
{
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 @@
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)
diff --git a/drivers/staging/lustre/lnet/lnet/api-ni.c b/drivers/staging/lustre/lnet/lnet/api-ni.c
index 3b2488f..fd4153b 100644
--- a/drivers/staging/lustre/lnet/lnet/api-ni.c
+++ b/drivers/staging/lustre/lnet/lnet/api-ni.c
@@ -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);
--
1.8.3.1
next prev parent reply other threads:[~2017-01-22 0:43 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-22 0:40 [PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs to proper structure James Simmons
2017-01-22 0:40 ` [PATCH 1/8] staging: lustre: lnet: change lnet_handle_wire_t " James Simmons
2017-01-22 0:40 ` [PATCH 2/8] staging: lustre: lnet: change lnet_ping_info_t " James Simmons
2017-01-22 0:40 ` [PATCH 3/8] staging: lustre: lnet: change lnet_ni_status_t " James Simmons
2017-01-22 0:40 ` [PATCH 4/8] staging: lustre: lnet: change lnet_process_id_packed_t " James Simmons
2017-01-22 0:40 ` [PATCH 5/8] staging: lustre: lnet: change lnet_acceptor_connreq_t " James Simmons
2017-01-22 0:40 ` James Simmons [this message]
2017-01-22 0:40 ` [PATCH 7/8] staging: lustre: lnet: change lnet_hdr_t " James Simmons
2017-01-22 0:40 ` [PATCH 8/8] staging: lustre: lnet: change msg union in struct lnet_hdr " James Simmons
2017-01-23 21:01 ` [PATCH 0/8] staging: lustre: lnet: change wire protocol typedefs " Joe Perches
2017-01-29 23:56 ` James Simmons
2017-01-30 6:40 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1485045632-5886-7-git-send-email-jsimmons@infradead.org \
--to=jsimmons@infradead.org \
--cc=andreas.dilger@intel.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lustre-devel@lists.lustre.org \
--cc=oleg.drokin@intel.com \
--cc=uja.ornl@yahoo.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).