diff options
Diffstat (limited to 'drivers/block/drbd/drbd_main.c')
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index d418bca2bb14..b43ad87a536a 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -707,29 +707,29 @@ int _conn_send_cmd(struct drbd_tconn *tconn, int vnr, struct socket *sock, | |||
707 | /* don't pass the socket. we may only look at it | 707 | /* don't pass the socket. we may only look at it |
708 | * when we hold the appropriate socket mutex. | 708 | * when we hold the appropriate socket mutex. |
709 | */ | 709 | */ |
710 | int drbd_send_cmd(struct drbd_conf *mdev, int use_data_socket, | 710 | int conn_send_cmd(struct drbd_tconn *tconn, int vnr, int use_data_socket, |
711 | enum drbd_packet cmd, struct p_header *h, size_t size) | 711 | enum drbd_packet cmd, struct p_header *h, size_t size) |
712 | { | 712 | { |
713 | int ok = 0; | 713 | int ok = 0; |
714 | struct socket *sock; | 714 | struct socket *sock; |
715 | 715 | ||
716 | if (use_data_socket) { | 716 | if (use_data_socket) { |
717 | mutex_lock(&mdev->tconn->data.mutex); | 717 | mutex_lock(&tconn->data.mutex); |
718 | sock = mdev->tconn->data.socket; | 718 | sock = tconn->data.socket; |
719 | } else { | 719 | } else { |
720 | mutex_lock(&mdev->tconn->meta.mutex); | 720 | mutex_lock(&tconn->meta.mutex); |
721 | sock = mdev->tconn->meta.socket; | 721 | sock = tconn->meta.socket; |
722 | } | 722 | } |
723 | 723 | ||
724 | /* drbd_disconnect() could have called drbd_free_sock() | 724 | /* drbd_disconnect() could have called drbd_free_sock() |
725 | * while we were waiting in down()... */ | 725 | * while we were waiting in down()... */ |
726 | if (likely(sock != NULL)) | 726 | if (likely(sock != NULL)) |
727 | ok = _drbd_send_cmd(mdev, sock, cmd, h, size, 0); | 727 | ok = _conn_send_cmd(tconn, vnr, sock, cmd, h, size, 0); |
728 | 728 | ||
729 | if (use_data_socket) | 729 | if (use_data_socket) |
730 | mutex_unlock(&mdev->tconn->data.mutex); | 730 | mutex_unlock(&tconn->data.mutex); |
731 | else | 731 | else |
732 | mutex_unlock(&mdev->tconn->meta.mutex); | 732 | mutex_unlock(&tconn->meta.mutex); |
733 | return ok; | 733 | return ok; |
734 | } | 734 | } |
735 | 735 | ||
@@ -2191,6 +2191,7 @@ struct drbd_tconn *drbd_new_tconn(char *name) | |||
2191 | spin_lock_init(&tconn->req_lock); | 2191 | spin_lock_init(&tconn->req_lock); |
2192 | atomic_set(&tconn->net_cnt, 0); | 2192 | atomic_set(&tconn->net_cnt, 0); |
2193 | init_waitqueue_head(&tconn->net_cnt_wait); | 2193 | init_waitqueue_head(&tconn->net_cnt_wait); |
2194 | init_waitqueue_head(&tconn->ping_wait); | ||
2194 | idr_init(&tconn->volumes); | 2195 | idr_init(&tconn->volumes); |
2195 | 2196 | ||
2196 | drbd_init_workqueue(&tconn->data.work); | 2197 | drbd_init_workqueue(&tconn->data.work); |