aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2011-02-07 10:47:12 -0500
committerPhilipp Reisner <philipp.reisner@linbit.com>2011-09-28 04:29:50 -0400
commit8a22cccc2068b35124f340fcc3f38b730007deff (patch)
tree9e6adc7937af79b4c9ddf6d8f259b7ead595eb18
parenta25b63f1e75df7dbc27666b627e6277d7fea92b7 (diff)
drbd: Converted drbd_send_handshake() from mdev to tconn
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
-rw-r--r--drivers/block/drbd/drbd_int.h2
-rw-r--r--drivers/block/drbd/drbd_receiver.c20
2 files changed, 11 insertions, 11 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index e640ffdad9cd..845ff34d2060 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -378,7 +378,7 @@ struct p_block_req {
378 */ 378 */
379 379
380struct p_handshake { 380struct p_handshake {
381 struct p_header head; /* Note: You must always use a h80 here */ 381 struct p_header head; /* Note: vnr will be ignored */
382 u32 protocol_min; 382 u32 protocol_min;
383 u32 feature_flags; 383 u32 feature_flags;
384 u32 protocol_max; 384 u32 protocol_max;
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index 60a4f651a084..565f2ea47ab8 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -3952,28 +3952,28 @@ static void drbd_disconnect(struct drbd_conf *mdev)
3952 * 3952 *
3953 * for now, they are expected to be zero, but ignored. 3953 * for now, they are expected to be zero, but ignored.
3954 */ 3954 */
3955static int drbd_send_handshake(struct drbd_conf *mdev) 3955static int drbd_send_handshake(struct drbd_tconn *tconn)
3956{ 3956{
3957 /* ASSERT current == mdev->tconn->receiver ... */ 3957 /* ASSERT current == mdev->tconn->receiver ... */
3958 struct p_handshake *p = &mdev->tconn->data.sbuf.handshake; 3958 struct p_handshake *p = &tconn->data.sbuf.handshake;
3959 int ok; 3959 int ok;
3960 3960
3961 if (mutex_lock_interruptible(&mdev->tconn->data.mutex)) { 3961 if (mutex_lock_interruptible(&tconn->data.mutex)) {
3962 dev_err(DEV, "interrupted during initial handshake\n"); 3962 conn_err(tconn, "interrupted during initial handshake\n");
3963 return 0; /* interrupted. not ok. */ 3963 return 0; /* interrupted. not ok. */
3964 } 3964 }
3965 3965
3966 if (mdev->tconn->data.socket == NULL) { 3966 if (tconn->data.socket == NULL) {
3967 mutex_unlock(&mdev->tconn->data.mutex); 3967 mutex_unlock(&tconn->data.mutex);
3968 return 0; 3968 return 0;
3969 } 3969 }
3970 3970
3971 memset(p, 0, sizeof(*p)); 3971 memset(p, 0, sizeof(*p));
3972 p->protocol_min = cpu_to_be32(PRO_VERSION_MIN); 3972 p->protocol_min = cpu_to_be32(PRO_VERSION_MIN);
3973 p->protocol_max = cpu_to_be32(PRO_VERSION_MAX); 3973 p->protocol_max = cpu_to_be32(PRO_VERSION_MAX);
3974 ok = _drbd_send_cmd(mdev, mdev->tconn->data.socket, P_HAND_SHAKE, 3974 ok = _conn_send_cmd(tconn, 0, tconn->data.socket, P_HAND_SHAKE,
3975 &p->head, sizeof(*p), 0 ); 3975 &p->head, sizeof(*p), 0);
3976 mutex_unlock(&mdev->tconn->data.mutex); 3976 mutex_unlock(&tconn->data.mutex);
3977 return ok; 3977 return ok;
3978} 3978}
3979 3979
@@ -3993,7 +3993,7 @@ static int drbd_do_handshake(struct drbd_conf *mdev)
3993 enum drbd_packet cmd; 3993 enum drbd_packet cmd;
3994 int rv; 3994 int rv;
3995 3995
3996 rv = drbd_send_handshake(mdev); 3996 rv = drbd_send_handshake(mdev->tconn);
3997 if (!rv) 3997 if (!rv)
3998 return 0; 3998 return 0;
3999 3999