}
wake_up(&tconn->ping_wait);
- return true;
+ return 0;
}
static int got_RqSReply(struct drbd_tconn *tconn, struct packet_info *pi)
mdev = vnr_to_mdev(tconn, pi->vnr);
if (!mdev)
- return false;
+ return -EIO;
if (retcode >= SS_SUCCESS) {
set_bit(CL_ST_CHG_SUCCESS, &mdev->flags);
}
wake_up(&mdev->state_wait);
- return true;
+ return 0;
}
static int got_Ping(struct drbd_tconn *tconn, struct packet_info *pi)
{
- return !drbd_send_ping_ack(tconn);
+ return drbd_send_ping_ack(tconn);
}
if (!test_and_set_bit(GOT_PING_ACK, &tconn->flags))
wake_up(&tconn->ping_wait);
- return true;
+ return 0;
}
static int got_IsInSync(struct drbd_tconn *tconn, struct packet_info *pi)
mdev = vnr_to_mdev(tconn, pi->vnr);
if (!mdev)
- return false;
+ return -EIO;
D_ASSERT(mdev->tconn->agreed_pro_version >= 89);
dec_rs_pending(mdev);
atomic_add(blksize >> 9, &mdev->rs_sect_in);
- return true;
+ return 0;
}
static int
mdev = vnr_to_mdev(tconn, pi->vnr);
if (!mdev)
- return false;
+ return -EIO;
update_peer_seq(mdev, be32_to_cpu(p->seq_num));
if (p->block_id == ID_SYNCER) {
drbd_set_in_sync(mdev, sector, blksize);
dec_rs_pending(mdev);
- return true;
+ return 0;
}
switch (pi->cmd) {
case P_RS_WRITE_ACK:
what = POSTPONE_WRITE;
break;
default:
- D_ASSERT(0);
- return false;
+ BUG();
}
- return !validate_req_change_req_state(mdev, p->block_id, sector,
- &mdev->write_requests, __func__,
- what, false);
+ return validate_req_change_req_state(mdev, p->block_id, sector,
+ &mdev->write_requests, __func__,
+ what, false);
}
static int got_NegAck(struct drbd_tconn *tconn, struct packet_info *pi)
mdev = vnr_to_mdev(tconn, pi->vnr);
if (!mdev)
- return false;
+ return -EIO;
update_peer_seq(mdev, be32_to_cpu(p->seq_num));
if (p->block_id == ID_SYNCER) {
dec_rs_pending(mdev);
drbd_rs_failed_io(mdev, sector, size);
- return true;
+ return 0;
}
err = validate_req_change_req_state(mdev, p->block_id, sector,
/* In Protocol B we might already have got a P_RECV_ACK
but then get a P_NEG_ACK afterwards. */
if (!missing_ok)
- return false;
+ return err;
drbd_set_out_of_sync(mdev, sector, size);
}
- return true;
+ return 0;
}
static int got_NegDReply(struct drbd_tconn *tconn, struct packet_info *pi)
mdev = vnr_to_mdev(tconn, pi->vnr);
if (!mdev)
- return false;
+ return -EIO;
update_peer_seq(mdev, be32_to_cpu(p->seq_num));
dev_err(DEV, "Got NegDReply; Sector %llus, len %u; Fail original request.\n",
(unsigned long long)sector, be32_to_cpu(p->blksize));
- return !validate_req_change_req_state(mdev, p->block_id, sector,
- &mdev->read_requests, __func__,
- NEG_ACKED, false);
+ return validate_req_change_req_state(mdev, p->block_id, sector,
+ &mdev->read_requests, __func__,
+ NEG_ACKED, false);
}
static int got_NegRSDReply(struct drbd_tconn *tconn, struct packet_info *pi)
mdev = vnr_to_mdev(tconn, pi->vnr);
if (!mdev)
- return false;
+ return -EIO;
sector = be64_to_cpu(p->sector);
size = be32_to_cpu(p->blksize);
case P_RS_CANCEL:
break;
default:
- D_ASSERT(0);
- put_ldev(mdev);
- return false;
+ BUG();
}
put_ldev(mdev);
}
- return true;
+ return 0;
}
static int got_BarrierAck(struct drbd_tconn *tconn, struct packet_info *pi)
mdev = vnr_to_mdev(tconn, pi->vnr);
if (!mdev)
- return false;
+ return -EIO;
tl_release(mdev->tconn, p->barrier, be32_to_cpu(p->set_size));
add_timer(&mdev->start_resync_timer);
}
- return true;
+ return 0;
}
static int got_OVResult(struct drbd_tconn *tconn, struct packet_info *pi)
mdev = vnr_to_mdev(tconn, pi->vnr);
if (!mdev)
- return false;
+ return -EIO;
sector = be64_to_cpu(p->sector);
size = be32_to_cpu(p->blksize);
ov_out_of_sync_print(mdev);
if (!get_ldev(mdev))
- return true;
+ return 0;
drbd_rs_complete_io(mdev, sector);
dec_rs_pending(mdev);
}
}
put_ldev(mdev);
- return true;
+ return 0;
}
static int got_skip(struct drbd_tconn *tconn, struct packet_info *pi)
{
- return true;
+ return 0;
}
static int tconn_process_done_ee(struct drbd_tconn *tconn)
}
}
if (received == expect) {
- bool rv;
+ bool err;
- rv = cmd->fn(tconn, &pi);
- if (!rv) {
+ err = cmd->fn(tconn, &pi);
+ if (err) {
conn_err(tconn, "%pf failed\n", cmd->fn);
goto reconnect;
}