return err;
}
-static int drbd_recv_short(struct drbd_conf *mdev, struct socket *sock,
- void *buf, size_t size, int flags)
+static int drbd_recv_short(struct socket *sock, void *buf, size_t size, int flags)
{
mm_segment_t oldfs;
struct kvec iov = {
struct p_header80 *h = &mdev->tconn->data.rbuf.header.h80;
int rr;
- rr = drbd_recv_short(mdev, sock, h, sizeof(*h), 0);
+ rr = drbd_recv_short(sock, h, sizeof(*h), 0);
if (rr == sizeof(*h) && h->magic == cpu_to_be32(DRBD_MAGIC))
return be16_to_cpu(h->command);
/**
* drbd_socket_okay() - Free the socket if its connection is not okay
- * @mdev: DRBD device.
* @sock: pointer to the pointer to the socket.
*/
-static int drbd_socket_okay(struct drbd_conf *mdev, struct socket **sock)
+static int drbd_socket_okay(struct socket **sock)
{
int rr;
char tb[4];
if (!*sock)
return false;
- rr = drbd_recv_short(mdev, *sock, tb, 4, MSG_DONTWAIT | MSG_PEEK);
+ rr = drbd_recv_short(*sock, tb, 4, MSG_DONTWAIT | MSG_PEEK);
if (rr > 0 || rr == -EAGAIN) {
return true;
if (sock && msock) {
schedule_timeout_interruptible(mdev->tconn->net_conf->ping_timeo*HZ/10);
- ok = drbd_socket_okay(mdev, &sock);
- ok = drbd_socket_okay(mdev, &msock) && ok;
+ ok = drbd_socket_okay(&sock);
+ ok = drbd_socket_okay(&msock) && ok;
if (ok)
break;
}
s = drbd_wait_for_connect(mdev->tconn);
if (s) {
try = drbd_recv_fp(mdev, s);
- drbd_socket_okay(mdev, &sock);
- drbd_socket_okay(mdev, &msock);
+ drbd_socket_okay(&sock);
+ drbd_socket_okay(&msock);
switch (try) {
case P_HAND_SHAKE_S:
if (sock) {
}
if (sock && msock) {
- ok = drbd_socket_okay(mdev, &sock);
- ok = drbd_socket_okay(mdev, &msock) && ok;
+ ok = drbd_socket_okay(&sock);
+ ok = drbd_socket_okay(&msock) && ok;
if (ok)
break;
}
if (signal_pending(current))
continue;
- rv = drbd_recv_short(mdev, mdev->tconn->meta.socket,
- buf, expect-received, 0);
+ rv = drbd_recv_short(mdev->tconn->meta.socket, buf, expect-received, 0);
clear_bit(SIGNAL_ASENDER, &mdev->tconn->flags);
flush_signals(current);