Commit 9ba7aa00 authored by Philipp Reisner's avatar Philipp Reisner

drbd: Converted drbd_recv_header() from mdev to tconn

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent ce243853
...@@ -949,20 +949,20 @@ static bool decode_header(struct drbd_tconn *tconn, struct p_header *h, struct p ...@@ -949,20 +949,20 @@ static bool decode_header(struct drbd_tconn *tconn, struct p_header *h, struct p
return true; return true;
} }
static int drbd_recv_header(struct drbd_conf *mdev, struct packet_info *pi) static int drbd_recv_header(struct drbd_tconn *tconn, struct packet_info *pi)
{ {
struct p_header *h = &mdev->tconn->data.rbuf.header; struct p_header *h = &tconn->data.rbuf.header;
int r; int r;
r = drbd_recv(mdev->tconn, h, sizeof(*h)); r = drbd_recv(tconn, h, sizeof(*h));
if (unlikely(r != sizeof(*h))) { if (unlikely(r != sizeof(*h))) {
if (!signal_pending(current)) if (!signal_pending(current))
dev_warn(DEV, "short read expecting header on sock: r=%d\n", r); conn_warn(tconn, "short read expecting header on sock: r=%d\n", r);
return false; return false;
} }
r = decode_header(mdev->tconn, h, pi); r = decode_header(tconn, h, pi);
mdev->tconn->last_received = jiffies; tconn->last_received = jiffies;
return r; return r;
} }
...@@ -3639,7 +3639,7 @@ static int receive_bitmap(struct drbd_conf *mdev, enum drbd_packet cmd, ...@@ -3639,7 +3639,7 @@ static int receive_bitmap(struct drbd_conf *mdev, enum drbd_packet cmd,
goto out; goto out;
break; break;
} }
if (!drbd_recv_header(mdev, &pi)) if (!drbd_recv_header(mdev->tconn, &pi))
goto out; goto out;
cmd = pi.cmd; cmd = pi.cmd;
data_size = pi.size; data_size = pi.size;
...@@ -3776,7 +3776,7 @@ static void drbdd(struct drbd_conf *mdev) ...@@ -3776,7 +3776,7 @@ static void drbdd(struct drbd_conf *mdev)
while (get_t_state(&mdev->tconn->receiver) == RUNNING) { while (get_t_state(&mdev->tconn->receiver) == RUNNING) {
drbd_thread_current_set_cpu(mdev, &mdev->tconn->receiver); drbd_thread_current_set_cpu(mdev, &mdev->tconn->receiver);
if (!drbd_recv_header(mdev, &pi)) if (!drbd_recv_header(mdev->tconn, &pi))
goto err_out; goto err_out;
if (unlikely(pi.cmd >= P_MAX_CMD || !drbd_cmd_handler[pi.cmd].function)) { if (unlikely(pi.cmd >= P_MAX_CMD || !drbd_cmd_handler[pi.cmd].function)) {
...@@ -4003,7 +4003,7 @@ static int drbd_do_handshake(struct drbd_conf *mdev) ...@@ -4003,7 +4003,7 @@ static int drbd_do_handshake(struct drbd_conf *mdev)
if (!rv) if (!rv)
return 0; return 0;
rv = drbd_recv_header(mdev, &pi); rv = drbd_recv_header(mdev->tconn, &pi);
if (!rv) if (!rv)
return 0; return 0;
...@@ -4097,7 +4097,7 @@ static int drbd_do_auth(struct drbd_conf *mdev) ...@@ -4097,7 +4097,7 @@ static int drbd_do_auth(struct drbd_conf *mdev)
if (!rv) if (!rv)
goto fail; goto fail;
rv = drbd_recv_header(mdev, &pi); rv = drbd_recv_header(mdev->tconn, &pi);
if (!rv) if (!rv)
goto fail; goto fail;
...@@ -4152,7 +4152,7 @@ static int drbd_do_auth(struct drbd_conf *mdev) ...@@ -4152,7 +4152,7 @@ static int drbd_do_auth(struct drbd_conf *mdev)
if (!rv) if (!rv)
goto fail; goto fail;
rv = drbd_recv_header(mdev, &pi); rv = drbd_recv_header(mdev->tconn, &pi);
if (!rv) if (!rv)
goto fail; goto fail;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment