mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: drbd-dev@lists.linbit.com
Subject: [PATCH 06/16] drbd: Pass struct packet_info down to the asender receive functions
Date: Thu,  8 Sep 2011 14:45:27 +0200	[thread overview]
Message-ID: <1315485937-18989-7-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1315485937-18989-1-git-send-email-philipp.reisner@linbit.com>

From: Andreas Gruenbacher <agruen@linbit.com>

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
 drivers/block/drbd/drbd_receiver.c |   36 ++++++++++++++++++------------------
 1 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index e45a417..5e464a7 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -4462,7 +4462,7 @@ int drbdd_init(struct drbd_thread *thi)
 
 /* ********* acknowledge sender ******** */
 
-static int got_conn_RqSReply(struct drbd_tconn *tconn, enum drbd_packet cmd)
+static int got_conn_RqSReply(struct drbd_tconn *tconn, struct packet_info *pi)
 {
 	struct p_req_state_reply *p = tconn->meta.rbuf;
 	int retcode = be32_to_cpu(p->retcode);
@@ -4479,7 +4479,7 @@ static int got_conn_RqSReply(struct drbd_tconn *tconn, enum drbd_packet cmd)
 	return true;
 }
 
-static int got_RqSReply(struct drbd_conf *mdev, enum drbd_packet cmd)
+static int got_RqSReply(struct drbd_conf *mdev, struct packet_info *pi)
 {
 	struct p_req_state_reply *p = mdev->tconn->meta.rbuf;
 	int retcode = be32_to_cpu(p->retcode);
@@ -4496,13 +4496,13 @@ static int got_RqSReply(struct drbd_conf *mdev, enum drbd_packet cmd)
 	return true;
 }
 
-static int got_Ping(struct drbd_tconn *tconn, enum drbd_packet cmd)
+static int got_Ping(struct drbd_tconn *tconn, struct packet_info *pi)
 {
 	return drbd_send_ping_ack(tconn);
 
 }
 
-static int got_PingAck(struct drbd_tconn *tconn, enum drbd_packet cmd)
+static int got_PingAck(struct drbd_tconn *tconn, struct packet_info *pi)
 {
 	/* restore idle timeout */
 	tconn->meta.socket->sk->sk_rcvtimeo = tconn->net_conf->ping_int*HZ;
@@ -4512,7 +4512,7 @@ static int got_PingAck(struct drbd_tconn *tconn, enum drbd_packet cmd)
 	return true;
 }
 
-static int got_IsInSync(struct drbd_conf *mdev, enum drbd_packet cmd)
+static int got_IsInSync(struct drbd_conf *mdev, struct packet_info *pi)
 {
 	struct p_block_ack *p = mdev->tconn->meta.rbuf;
 	sector_t sector = be64_to_cpu(p->sector);
@@ -4557,7 +4557,7 @@ validate_req_change_req_state(struct drbd_conf *mdev, u64 id, sector_t sector,
 	return true;
 }
 
-static int got_BlockAck(struct drbd_conf *mdev, enum drbd_packet cmd)
+static int got_BlockAck(struct drbd_conf *mdev, struct packet_info *pi)
 {
 	struct p_block_ack *p = mdev->tconn->meta.rbuf;
 	sector_t sector = be64_to_cpu(p->sector);
@@ -4571,7 +4571,7 @@ static int got_BlockAck(struct drbd_conf *mdev, enum drbd_packet cmd)
 		dec_rs_pending(mdev);
 		return true;
 	}
-	switch (cmd) {
+	switch (pi->cmd) {
 	case P_RS_WRITE_ACK:
 		D_ASSERT(mdev->tconn->net_conf->wire_protocol == DRBD_PROT_C);
 		what = WRITE_ACKED_BY_PEER_AND_SIS;
@@ -4602,7 +4602,7 @@ static int got_BlockAck(struct drbd_conf *mdev, enum drbd_packet cmd)
 					     what, false);
 }
 
-static int got_NegAck(struct drbd_conf *mdev, enum drbd_packet cmd)
+static int got_NegAck(struct drbd_conf *mdev, struct packet_info *pi)
 {
 	struct p_block_ack *p = mdev->tconn->meta.rbuf;
 	sector_t sector = be64_to_cpu(p->sector);
@@ -4635,7 +4635,7 @@ static int got_NegAck(struct drbd_conf *mdev, enum drbd_packet cmd)
 	return true;
 }
 
-static int got_NegDReply(struct drbd_conf *mdev, enum drbd_packet cmd)
+static int got_NegDReply(struct drbd_conf *mdev, struct packet_info *pi)
 {
 	struct p_block_ack *p = mdev->tconn->meta.rbuf;
 	sector_t sector = be64_to_cpu(p->sector);
@@ -4650,7 +4650,7 @@ static int got_NegDReply(struct drbd_conf *mdev, enum drbd_packet cmd)
 					     NEG_ACKED, false);
 }
 
-static int got_NegRSDReply(struct drbd_conf *mdev, enum drbd_packet cmd)
+static int got_NegRSDReply(struct drbd_conf *mdev, struct packet_info *pi)
 {
 	sector_t sector;
 	int size;
@@ -4665,7 +4665,7 @@ static int got_NegRSDReply(struct drbd_conf *mdev, enum drbd_packet cmd)
 
 	if (get_ldev_if_state(mdev, D_FAILED)) {
 		drbd_rs_complete_io(mdev, sector);
-		switch (cmd) {
+		switch (pi->cmd) {
 		case P_NEG_RS_DREPLY:
 			drbd_rs_failed_io(mdev, sector, size);
 		case P_RS_CANCEL:
@@ -4681,7 +4681,7 @@ static int got_NegRSDReply(struct drbd_conf *mdev, enum drbd_packet cmd)
 	return true;
 }
 
-static int got_BarrierAck(struct drbd_conf *mdev, enum drbd_packet cmd)
+static int got_BarrierAck(struct drbd_conf *mdev, struct packet_info *pi)
 {
 	struct p_barrier_ack *p = mdev->tconn->meta.rbuf;
 
@@ -4697,7 +4697,7 @@ static int got_BarrierAck(struct drbd_conf *mdev, enum drbd_packet cmd)
 	return true;
 }
 
-static int got_OVResult(struct drbd_conf *mdev, enum drbd_packet cmd)
+static int got_OVResult(struct drbd_conf *mdev, struct packet_info *pi)
 {
 	struct p_block_ack *p = mdev->tconn->meta.rbuf;
 	struct drbd_work *w;
@@ -4742,7 +4742,7 @@ static int got_OVResult(struct drbd_conf *mdev, enum drbd_packet cmd)
 	return true;
 }
 
-static int got_skip(struct drbd_conf *mdev, enum drbd_packet cmd)
+static int got_skip(struct drbd_conf *mdev, struct packet_info *pi)
 {
 	return true;
 }
@@ -4777,8 +4777,8 @@ struct asender_cmd {
 	size_t pkt_size;
 	enum mdev_or_conn fa_type; /* first argument's type */
 	union {
-		int (*mdev_fn)(struct drbd_conf *mdev, enum drbd_packet cmd);
-		int (*conn_fn)(struct drbd_tconn *tconn, enum drbd_packet cmd);
+		int (*mdev_fn)(struct drbd_conf *mdev, struct packet_info *);
+		int (*conn_fn)(struct drbd_tconn *tconn, struct packet_info *);
 	};
 };
 
@@ -4905,10 +4905,10 @@ int drbd_asender(struct drbd_thread *thi)
 			bool rv;
 
 			if (cmd->fa_type == CONN) {
-				rv = cmd->conn_fn(tconn, pi.cmd);
+				rv = cmd->conn_fn(tconn, &pi);
 			} else {
 				struct drbd_conf *mdev = vnr_to_mdev(tconn, pi.vnr);
-				rv = cmd->mdev_fn(mdev, pi.cmd);
+				rv = cmd->mdev_fn(mdev, &pi);
 			}
 
 			if (!rv)
-- 
1.7.4.1


  parent reply	other threads:[~2011-09-08 12:49 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-08 12:45 [RFC 00/16] drbd: part 8 of adding multiple volume support to drbd Philipp Reisner
2011-09-08 12:45 ` [PATCH 01/16] drbd: Use the idr_for_each_entry() iterator instead of idr_for_each() Philipp Reisner
2011-09-08 12:45 ` [PATCH 02/16] drbd: Fixed logging of old connection state Philipp Reisner
2011-09-08 12:45 ` [PATCH 03/16] drbd: Print common state changes of all volumes as connection state changes Philipp Reisner
2011-09-08 12:45 ` [PATCH 04/16] drbd: Allow to disconnect if one volume is diskless Philipp Reisner
2011-09-08 12:45 ` [PATCH 05/16] drbd: Do not segfault if a sync dependency reaches a diskless device Philipp Reisner
2011-09-08 12:45 ` Philipp Reisner [this message]
2011-09-08 12:45 ` [PATCH 07/16] drbd: Map from (connection, volume number) to device in the asender handlers Philipp Reisner
2011-09-08 12:45 ` [PATCH 08/16] drbd: drbd_connect(): Initialize struct drbd_socket before sending anything Philipp Reisner
2011-09-08 12:45 ` [PATCH 09/16] drbd: _conn_send_cmd(), _drbd_send_cmd(): Pass a struct drbd_socket instead of a plain socket Philipp Reisner
2011-09-08 12:45 ` [PATCH 10/16] drbd: Change how the initial packets are called Philipp Reisner
2011-09-08 12:45 ` [PATCH 11/16] drbd: Change how the "handshake" " Philipp Reisner
2011-09-08 12:45 ` [PATCH 12/16] drbd: introduce the "initialized" activity log transaction type Philipp Reisner
2011-09-08 12:45 ` [PATCH 13/16] drbd: preparation commit, pass drbd_interval to drbd_al_begin/complete_io Philipp Reisner
2011-09-08 12:45 ` [PATCH 14/16] drbd: prepare to activate two activity log extents at once Philipp Reisner
2011-09-08 12:45 ` [PATCH 15/16] drbd: get rid of bio_split, allow bios of "arbitrary" size Philipp Reisner
2011-09-08 12:45 ` [PATCH 16/16] drbd: improvements to activate/deactivate multiple activity log extents Philipp Reisner

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=1315485937-18989-7-git-send-email-philipp.reisner@linbit.com \
    --to=philipp.reisner@linbit.com \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --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

all inboxes | Powered by JetHome®