drbd: _conn_send_cmd(), _drbd_send_cmd(): Pass a struct drbd_socket instead of a plain socket

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 3e32836..4c94be2 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -719,14 +719,14 @@
 }
 
 /* the appropriate socket mutex must be held already */
-int _conn_send_cmd(struct drbd_tconn *tconn, int vnr, struct socket *sock,
+int _conn_send_cmd(struct drbd_tconn *tconn, int vnr, struct drbd_socket *sock,
 		   enum drbd_packet cmd, struct p_header *h, size_t size,
 		   unsigned msg_flags)
 {
 	int err;
 
 	_prepare_header(tconn, vnr, h, cmd, size - sizeof(struct p_header));
-	err = drbd_send_all(tconn, sock, h, size, msg_flags);
+	err = drbd_send_all(tconn, sock->socket, h, size, msg_flags);
 	if (err && !signal_pending(current))
 		conn_warn(tconn, "short send %s size=%d\n",
 			  cmdname(cmd), (int)size);
@@ -743,7 +743,7 @@
 
 	mutex_lock(&sock->mutex);
 	if (sock->socket)
-		err = _conn_send_cmd(tconn, vnr, sock->socket, cmd, h, size, 0);
+		err = _conn_send_cmd(tconn, vnr, sock, cmd, h, size, 0);
 	mutex_unlock(&sock->mutex);
 	return err;
 }
@@ -780,7 +780,7 @@
 int drbd_send_sync_param(struct drbd_conf *mdev)
 {
 	struct p_rs_param_95 *p;
-	struct socket *sock;
+	struct drbd_socket *sock;
 	int size, err;
 	const int apv = mdev->tconn->agreed_pro_version;
 
@@ -791,9 +791,9 @@
 		: /* apv >= 95 */ sizeof(struct p_rs_param_95);
 
 	mutex_lock(&mdev->tconn->data.mutex);
-	sock = mdev->tconn->data.socket;
+	sock = &mdev->tconn->data;
 
-	if (likely(sock != NULL)) {
+	if (likely(sock->socket != NULL)) {
 		enum drbd_packet cmd =
 			apv >= 89 ? P_SYNC_PARAM89 : P_SYNC_PARAM;
 
@@ -979,16 +979,16 @@
  */
 int drbd_send_state(struct drbd_conf *mdev)
 {
-	struct socket *sock;
+	struct drbd_socket *sock;
 	struct p_state p;
 	int err = -EIO;
 
 	mutex_lock(&mdev->tconn->data.mutex);
 
 	p.state = cpu_to_be32(mdev->state.i); /* Within the send mutex */
-	sock = mdev->tconn->data.socket;
+	sock = &mdev->tconn->data;
 
-	if (likely(sock != NULL))
+	if (likely(sock->socket != NULL))
 		err = _drbd_send_cmd(mdev, sock, P_STATE, &p.head, sizeof(p), 0);
 
 	mutex_unlock(&mdev->tconn->data.mutex);
@@ -1157,7 +1157,7 @@
 
 	if (len) {
 		dcbp_set_code(p, RLE_VLI_Bits);
-		err = _drbd_send_cmd(mdev, mdev->tconn->data.socket,
+		err = _drbd_send_cmd(mdev, &mdev->tconn->data,
 				     P_COMPRESSED_BITMAP, &p->head,
 				     sizeof(*p) + len, 0);
 
@@ -1175,7 +1175,7 @@
 		if (len)
 			drbd_bm_get_lel(mdev, c->word_offset, num_words,
 					(unsigned long *)h->payload);
-		err = _drbd_send_cmd(mdev, mdev->tconn->data.socket, P_BITMAP,
+		err = _drbd_send_cmd(mdev, &mdev->tconn->data, P_BITMAP,
 				     h, sizeof(struct p_header80) + len, 0);
 		c->word_offset += num_words;
 		c->bit_offset = c->word_offset * BITS_PER_LONG;