public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: Kyle Moffett <kyle@moffetthome.net>,
	linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: drbd-dev@lists.linbit.com
Subject: [PATCH 9/9] drbd: Removed outdated comments and code that envisioned VNRs in header 95
Date: Wed, 28 Sep 2011 11:21:38 +0200	[thread overview]
Message-ID: <1317201698-7776-1-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <201109281120.07349.philipp.reisner@linbit.com>

From: Andreas Gruenbacher <agruen@linbit.com>

Since have now header 100, that has space for 16 bit volume numbers,
the high byte of the length in header 95 is no longer reserved for
8 bit volume numbers.

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
 drivers/block/drbd/drbd_int.h      |    2 +-
 drivers/block/drbd/drbd_main.c     |    2 +-
 drivers/block/drbd/drbd_receiver.c |    5 ++---
 3 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 2fcf370..8f67093 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -304,7 +304,7 @@ struct p_header80 {
 struct p_header95 {
 	u16	  magic;	/* use DRBD_MAGIC_BIG here */
 	u16	  command;
-	u32	  length;	/* Use only 24 bits of that. Ignore the highest 8 bit. */
+	u32	  length;
 } __packed;
 
 struct p_header100 {
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 2c75a03..6afcfab 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -721,7 +721,7 @@ static unsigned int prepare_header95(struct p_header95 *h, enum drbd_packet cmd,
 {
 	h->magic   = cpu_to_be16(DRBD_MAGIC_BIG);
 	h->command = cpu_to_be16(cmd);
-	h->length  = cpu_to_be32(size);
+	h->length = cpu_to_be32(size);
 	return sizeof(struct p_header95);
 }
 
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 80bbc55..7539253 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -996,10 +996,9 @@ static int decode_header(struct drbd_tconn *tconn, void *header, struct packet_i
 	} else if (header_size == sizeof(struct p_header95) &&
 		   *(__be16 *)header == cpu_to_be16(DRBD_MAGIC_BIG)) {
 		struct p_header95 *h = header;
-
 		pi->cmd = be16_to_cpu(h->command);
-		pi->size = be32_to_cpu(h->length) & 0x00ffffff;
-		pi->vnr  = 0;
+		pi->size = be32_to_cpu(h->length);
+		pi->vnr = 0;
 	} else if (header_size == sizeof(struct p_header80) &&
 		   *(__be32 *)header == cpu_to_be32(DRBD_MAGIC)) {
 		struct p_header80 *h = header;
-- 
1.7.4.1


  reply	other threads:[~2011-09-28  9:21 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-23 14:31 [RFC 00/10] drbd: part 10 of adding multiple volume support to drbd Philipp Reisner
2011-09-23 14:31 ` [PATCH 01/10] drbd: drbd_send_ping(), drbd_send_ping(): Return 0 upon success and an error code otherwise Philipp Reisner
2011-09-23 14:31 ` [PATCH 02/10] drbd: Introduce new primitives for sending commands Philipp Reisner
2011-09-23 14:31 ` [PATCH 03/10] drbd: Introduce drbd_header_size() Philipp Reisner
2011-09-23 14:31 ` [PATCH 04/10] drbd: Replace and remove old primitives Philipp Reisner
2011-09-23 17:33   ` Kyle Moffett
2011-09-27  9:34     ` Philipp Reisner
2011-09-23 14:31 ` [PATCH 05/10] drbd: Remove now-unused int_dig_out buffer Philipp Reisner
2011-09-23 14:31 ` [PATCH 06/10] drbd: Remove some fixed header size assumptions Philipp Reisner
2011-09-23 14:31 ` [PATCH 07/10] drbd: Remove headers from on-the-wire data structures (struct p_*) Philipp Reisner
2011-09-23 17:38   ` Kyle Moffett
2011-09-27  9:34     ` Philipp Reisner
2011-09-23 14:31 ` [PATCH 08/10] drbd: Introduce protocol version 100 headers Philipp Reisner
2011-09-23 17:42   ` Kyle Moffett
2011-09-27  9:34     ` Philipp Reisner
2011-09-23 14:31 ` [PATCH 09/10] drbd: Remove volume numbers from struct p_header95 Philipp Reisner
2011-09-23 17:28   ` Kyle Moffett
2011-09-27  9:34     ` Philipp Reisner
2011-09-28  4:26       ` Kyle Moffett
2011-09-28  9:20         ` Philipp Reisner
2011-09-28  9:21           ` Philipp Reisner [this message]
2011-09-23 14:31 ` [PATCH 10/10] drbd: For protocol versions before 100, use mixed header versions Philipp Reisner
2011-09-23 17:24   ` Kyle Moffett

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=1317201698-7776-1-git-send-email-philipp.reisner@linbit.com \
    --to=philipp.reisner@linbit.com \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=kyle@moffetthome.net \
    --cc=linux-kernel@vger.kernel.org \
    /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