drbd: drbd_send_ping(), drbd_send_ping(): Return 0 upon success and an error code otherwise
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
parent
8b924f1d63
commit
a17647aae4
2 changed files with 4 additions and 4 deletions
|
@ -768,13 +768,13 @@ int conn_send_cmd2(struct drbd_tconn *tconn, enum drbd_packet cmd, char *data,
|
||||||
int drbd_send_ping(struct drbd_tconn *tconn)
|
int drbd_send_ping(struct drbd_tconn *tconn)
|
||||||
{
|
{
|
||||||
struct p_header h;
|
struct p_header h;
|
||||||
return !conn_send_cmd(tconn, 0, &tconn->meta, P_PING, &h, sizeof(h));
|
return conn_send_cmd(tconn, 0, &tconn->meta, P_PING, &h, sizeof(h));
|
||||||
}
|
}
|
||||||
|
|
||||||
int drbd_send_ping_ack(struct drbd_tconn *tconn)
|
int drbd_send_ping_ack(struct drbd_tconn *tconn)
|
||||||
{
|
{
|
||||||
struct p_header h;
|
struct p_header h;
|
||||||
return !conn_send_cmd(tconn, 0, &tconn->meta, P_PING_ACK, &h, sizeof(h));
|
return conn_send_cmd(tconn, 0, &tconn->meta, P_PING_ACK, &h, sizeof(h));
|
||||||
}
|
}
|
||||||
|
|
||||||
int drbd_send_sync_param(struct drbd_conf *mdev)
|
int drbd_send_sync_param(struct drbd_conf *mdev)
|
||||||
|
|
|
@ -4498,7 +4498,7 @@ static int got_RqSReply(struct drbd_tconn *tconn, struct packet_info *pi)
|
||||||
|
|
||||||
static int got_Ping(struct drbd_tconn *tconn, struct packet_info *pi)
|
static int got_Ping(struct drbd_tconn *tconn, struct packet_info *pi)
|
||||||
{
|
{
|
||||||
return drbd_send_ping_ack(tconn);
|
return !drbd_send_ping_ack(tconn);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4851,7 +4851,7 @@ int drbd_asender(struct drbd_thread *thi)
|
||||||
while (get_t_state(thi) == RUNNING) {
|
while (get_t_state(thi) == RUNNING) {
|
||||||
drbd_thread_current_set_cpu(thi);
|
drbd_thread_current_set_cpu(thi);
|
||||||
if (test_and_clear_bit(SEND_PING, &tconn->flags)) {
|
if (test_and_clear_bit(SEND_PING, &tconn->flags)) {
|
||||||
if (!drbd_send_ping(tconn)) {
|
if (drbd_send_ping(tconn)) {
|
||||||
conn_err(tconn, "drbd_send_ping has failed\n");
|
conn_err(tconn, "drbd_send_ping has failed\n");
|
||||||
goto reconnect;
|
goto reconnect;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue