|
@@ -872,7 +872,7 @@ retry:
|
|
|
|
|
|
mdev->tconn->data.socket = sock;
|
|
|
mdev->tconn->meta.socket = msock;
|
|
|
- mdev->last_received = jiffies;
|
|
|
+ mdev->tconn->last_received = jiffies;
|
|
|
|
|
|
D_ASSERT(mdev->tconn->asender.task == NULL);
|
|
|
|
|
@@ -948,7 +948,7 @@ static int drbd_recv_header(struct drbd_conf *mdev, enum drbd_packets *cmd, unsi
|
|
|
be16_to_cpu(h->h80.length));
|
|
|
return false;
|
|
|
}
|
|
|
- mdev->last_received = jiffies;
|
|
|
+ mdev->tconn->last_received = jiffies;
|
|
|
|
|
|
return true;
|
|
|
}
|
|
@@ -1244,7 +1244,7 @@ read_in_block(struct drbd_conf *mdev, u64 id, sector_t sector, int data_size) __
|
|
|
void *dig_vv = mdev->int_dig_vv;
|
|
|
unsigned long *data;
|
|
|
|
|
|
- dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_r_tfm) ?
|
|
|
+ dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->integrity_r_tfm) ?
|
|
|
crypto_hash_digestsize(mdev->integrity_r_tfm) : 0;
|
|
|
|
|
|
if (dgs) {
|
|
@@ -1361,7 +1361,7 @@ static int recv_dless_read(struct drbd_conf *mdev, struct drbd_request *req,
|
|
|
void *dig_in = mdev->int_dig_in;
|
|
|
void *dig_vv = mdev->int_dig_vv;
|
|
|
|
|
|
- dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_r_tfm) ?
|
|
|
+ dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->integrity_r_tfm) ?
|
|
|
crypto_hash_digestsize(mdev->integrity_r_tfm) : 0;
|
|
|
|
|
|
if (dgs) {
|
|
@@ -2048,7 +2048,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un
|
|
|
goto out_free_e;
|
|
|
|
|
|
if (cmd == P_CSUM_RS_REQUEST) {
|
|
|
- D_ASSERT(mdev->agreed_pro_version >= 89);
|
|
|
+ D_ASSERT(mdev->tconn->agreed_pro_version >= 89);
|
|
|
e->w.cb = w_e_end_csum_rs_req;
|
|
|
/* used in the sector offset progress display */
|
|
|
mdev->bm_resync_fo = BM_SECT_TO_BIT(sector);
|
|
@@ -2065,7 +2065,7 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un
|
|
|
|
|
|
case P_OV_REQUEST:
|
|
|
if (mdev->ov_start_sector == ~(sector_t)0 &&
|
|
|
- mdev->agreed_pro_version >= 90) {
|
|
|
+ mdev->tconn->agreed_pro_version >= 90) {
|
|
|
unsigned long now = jiffies;
|
|
|
int i;
|
|
|
mdev->ov_start_sector = sector;
|
|
@@ -2360,7 +2360,7 @@ static int drbd_uuid_compare(struct drbd_conf *mdev, int *rule_nr) __must_hold(l
|
|
|
|
|
|
if (mdev->p_uuid[UI_BITMAP] == (u64)0 && mdev->ldev->md.uuid[UI_BITMAP] != (u64)0) {
|
|
|
|
|
|
- if (mdev->agreed_pro_version < 91)
|
|
|
+ if (mdev->tconn->agreed_pro_version < 91)
|
|
|
return -1091;
|
|
|
|
|
|
if ((mdev->ldev->md.uuid[UI_BITMAP] & ~((u64)1)) == (mdev->p_uuid[UI_HISTORY_START] & ~((u64)1)) &&
|
|
@@ -2381,7 +2381,7 @@ static int drbd_uuid_compare(struct drbd_conf *mdev, int *rule_nr) __must_hold(l
|
|
|
|
|
|
if (mdev->ldev->md.uuid[UI_BITMAP] == (u64)0 && mdev->p_uuid[UI_BITMAP] != (u64)0) {
|
|
|
|
|
|
- if (mdev->agreed_pro_version < 91)
|
|
|
+ if (mdev->tconn->agreed_pro_version < 91)
|
|
|
return -1091;
|
|
|
|
|
|
if ((mdev->ldev->md.uuid[UI_HISTORY_START] & ~((u64)1)) == (mdev->p_uuid[UI_BITMAP] & ~((u64)1)) &&
|
|
@@ -2427,14 +2427,14 @@ static int drbd_uuid_compare(struct drbd_conf *mdev, int *rule_nr) __must_hold(l
|
|
|
*rule_nr = 51;
|
|
|
peer = mdev->p_uuid[UI_HISTORY_START] & ~((u64)1);
|
|
|
if (self == peer) {
|
|
|
- if (mdev->agreed_pro_version < 96 ?
|
|
|
+ if (mdev->tconn->agreed_pro_version < 96 ?
|
|
|
(mdev->ldev->md.uuid[UI_HISTORY_START] & ~((u64)1)) ==
|
|
|
(mdev->p_uuid[UI_HISTORY_START + 1] & ~((u64)1)) :
|
|
|
peer + UUID_NEW_BM_OFFSET == (mdev->p_uuid[UI_BITMAP] & ~((u64)1))) {
|
|
|
/* The last P_SYNC_UUID did not get though. Undo the last start of
|
|
|
resync as sync source modifications of the peer's UUIDs. */
|
|
|
|
|
|
- if (mdev->agreed_pro_version < 91)
|
|
|
+ if (mdev->tconn->agreed_pro_version < 91)
|
|
|
return -1091;
|
|
|
|
|
|
mdev->p_uuid[UI_BITMAP] = mdev->p_uuid[UI_HISTORY_START];
|
|
@@ -2464,14 +2464,14 @@ static int drbd_uuid_compare(struct drbd_conf *mdev, int *rule_nr) __must_hold(l
|
|
|
*rule_nr = 71;
|
|
|
self = mdev->ldev->md.uuid[UI_HISTORY_START] & ~((u64)1);
|
|
|
if (self == peer) {
|
|
|
- if (mdev->agreed_pro_version < 96 ?
|
|
|
+ if (mdev->tconn->agreed_pro_version < 96 ?
|
|
|
(mdev->ldev->md.uuid[UI_HISTORY_START + 1] & ~((u64)1)) ==
|
|
|
(mdev->p_uuid[UI_HISTORY_START] & ~((u64)1)) :
|
|
|
self + UUID_NEW_BM_OFFSET == (mdev->ldev->md.uuid[UI_BITMAP] & ~((u64)1))) {
|
|
|
/* The last P_SYNC_UUID did not get though. Undo the last start of
|
|
|
resync as sync source modifications of our UUIDs. */
|
|
|
|
|
|
- if (mdev->agreed_pro_version < 91)
|
|
|
+ if (mdev->tconn->agreed_pro_version < 91)
|
|
|
return -1091;
|
|
|
|
|
|
_drbd_uuid_set(mdev, UI_BITMAP, mdev->ldev->md.uuid[UI_HISTORY_START]);
|
|
@@ -2731,7 +2731,7 @@ static int receive_protocol(struct drbd_conf *mdev, enum drbd_packets cmd, unsig
|
|
|
goto disconnect;
|
|
|
}
|
|
|
|
|
|
- if (mdev->agreed_pro_version >= 87) {
|
|
|
+ if (mdev->tconn->agreed_pro_version >= 87) {
|
|
|
unsigned char *my_alg = mdev->tconn->net_conf->integrity_alg;
|
|
|
|
|
|
if (drbd_recv(mdev, p_integrity_alg, data_size) != data_size)
|
|
@@ -2787,7 +2787,7 @@ static int receive_SyncParam(struct drbd_conf *mdev, enum drbd_packets cmd, unsi
|
|
|
unsigned int header_size, data_size, exp_max_sz;
|
|
|
struct crypto_hash *verify_tfm = NULL;
|
|
|
struct crypto_hash *csums_tfm = NULL;
|
|
|
- const int apv = mdev->agreed_pro_version;
|
|
|
+ const int apv = mdev->tconn->agreed_pro_version;
|
|
|
int *rs_plan_s = NULL;
|
|
|
int fifo_size = 0;
|
|
|
|
|
@@ -3074,7 +3074,7 @@ static int receive_uuids(struct drbd_conf *mdev, enum drbd_packets cmd, unsigned
|
|
|
if (get_ldev(mdev)) {
|
|
|
int skip_initial_sync =
|
|
|
mdev->state.conn == C_CONNECTED &&
|
|
|
- mdev->agreed_pro_version >= 90 &&
|
|
|
+ mdev->tconn->agreed_pro_version >= 90 &&
|
|
|
mdev->ldev->md.uuid[UI_CURRENT] == UUID_JUST_CREATED &&
|
|
|
(p_uuid[UI_FLAGS] & 8);
|
|
|
if (skip_initial_sync) {
|
|
@@ -3967,10 +3967,10 @@ static int drbd_do_handshake(struct drbd_conf *mdev)
|
|
|
PRO_VERSION_MIN > p->protocol_max)
|
|
|
goto incompat;
|
|
|
|
|
|
- mdev->agreed_pro_version = min_t(int, PRO_VERSION_MAX, p->protocol_max);
|
|
|
+ mdev->tconn->agreed_pro_version = min_t(int, PRO_VERSION_MAX, p->protocol_max);
|
|
|
|
|
|
dev_info(DEV, "Handshake successful: "
|
|
|
- "Agreed network protocol version %d\n", mdev->agreed_pro_version);
|
|
|
+ "Agreed network protocol version %d\n", mdev->tconn->agreed_pro_version);
|
|
|
|
|
|
return 1;
|
|
|
|
|
@@ -4220,7 +4220,7 @@ static int got_IsInSync(struct drbd_conf *mdev, struct p_header80 *h)
|
|
|
sector_t sector = be64_to_cpu(p->sector);
|
|
|
int blksize = be32_to_cpu(p->blksize);
|
|
|
|
|
|
- D_ASSERT(mdev->agreed_pro_version >= 89);
|
|
|
+ D_ASSERT(mdev->tconn->agreed_pro_version >= 89);
|
|
|
|
|
|
update_peer_seq(mdev, be32_to_cpu(p->seq_num));
|
|
|
|
|
@@ -4560,7 +4560,7 @@ int drbd_asender(struct drbd_thread *thi)
|
|
|
} else if (rv == -EAGAIN) {
|
|
|
/* If the data socket received something meanwhile,
|
|
|
* that is good enough: peer is still alive. */
|
|
|
- if (time_after(mdev->last_received,
|
|
|
+ if (time_after(mdev->tconn->last_received,
|
|
|
jiffies - mdev->tconn->meta.socket->sk->sk_rcvtimeo))
|
|
|
continue;
|
|
|
if (ping_timeout_active) {
|
|
@@ -4598,7 +4598,7 @@ int drbd_asender(struct drbd_thread *thi)
|
|
|
goto reconnect;
|
|
|
}
|
|
|
if (received == expect) {
|
|
|
- mdev->last_received = jiffies;
|
|
|
+ mdev->tconn->last_received = jiffies;
|
|
|
D_ASSERT(cmd != NULL);
|
|
|
if (!cmd->process(mdev, h))
|
|
|
goto reconnect;
|