/* ********* 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);
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);
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;
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);
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);
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;
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);
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);
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;
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:
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;
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;
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;
}
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 *);
};
};
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)