mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: drbd-dev@lists.linbit.com
Subject: [PATCH 033/118] drbd: moved agreed_pro_version, last_received and ko_count to tconn
Date: Thu, 25 Aug 2011 17:07:29 +0200	[thread overview]
Message-ID: <1314284934-17999-34-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1314284934-17999-1-git-send-email-philipp.reisner@linbit.com>

sed -i \
       -e 's/mdev->agreed_pro_version/mdev->tconn->agreed_pro_version/g' \
       -e 's/mdev->last_received/mdev->tconn->last_received/g' \
       -e 's/mdev->ko_count/mdev->tconn->ko_count/g' \
       *.[ch]

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
 drivers/block/drbd/drbd_int.h      |    8 +++---
 drivers/block/drbd/drbd_main.c     |   32 ++++++++++++++--------------
 drivers/block/drbd/drbd_nl.c       |    8 +++---
 drivers/block/drbd/drbd_receiver.c |   40 ++++++++++++++++++------------------
 drivers/block/drbd/drbd_req.c      |    2 +-
 drivers/block/drbd/drbd_worker.c   |    6 ++--
 6 files changed, 48 insertions(+), 48 deletions(-)

diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 6658dcb..ffc8211 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -972,6 +972,9 @@ struct drbd_tconn {			/* is a resource from the config file */
 
 	struct drbd_socket data;	/* data/barrier/cstate/parameter packets */
 	struct drbd_socket meta;	/* ping/ack (metadata) packets */
+	int agreed_pro_version;		/* actually used protocol version */
+	unsigned long last_received;	/* in jiffies, either socket */
+	unsigned int ko_count;
 
 	struct drbd_thread receiver;
 	struct drbd_thread worker;
@@ -994,9 +997,6 @@ struct drbd_conf {
 	struct block_device *this_bdev;
 	struct gendisk	    *vdisk;
 
-	int agreed_pro_version;  /* actually used protocol version */
-	unsigned long last_received; /* in jiffies, either socket */
-	unsigned int ko_count;
 	struct drbd_work  resync_work,
 			  unplug_work,
 			  go_diskless,
@@ -2297,7 +2297,7 @@ static inline int drbd_state_is_stable(struct drbd_conf *mdev)
 
 		/* Allow IO in BM exchange states with new protocols */
 	case C_WF_BITMAP_S:
-		if (mdev->agreed_pro_version < 96)
+		if (mdev->tconn->agreed_pro_version < 96)
 			return 0;
 		break;
 
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 5d8a6e9..e06ca4a 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -735,7 +735,7 @@ is_valid_state(struct drbd_conf *mdev, union drbd_state ns)
 		rv = SS_NO_VERIFY_ALG;
 
 	else if ((ns.conn == C_VERIFY_S || ns.conn == C_VERIFY_T) &&
-		  mdev->agreed_pro_version < 88)
+		  mdev->tconn->agreed_pro_version < 88)
 		rv = SS_NOT_SUPPORTED;
 
 	else if (ns.conn >= C_CONNECTED && ns.pdsk == D_UNKNOWN)
@@ -993,7 +993,7 @@ static union drbd_state sanitize_state(struct drbd_conf *mdev, union drbd_state
 /* helper for __drbd_set_state */
 static void set_ov_position(struct drbd_conf *mdev, enum drbd_conns cs)
 {
-	if (mdev->agreed_pro_version < 90)
+	if (mdev->tconn->agreed_pro_version < 90)
 		mdev->ov_start_sector = 0;
 	mdev->rs_total = drbd_bm_bits(mdev);
 	mdev->ov_position = 0;
@@ -1393,7 +1393,7 @@ static void after_state_ch(struct drbd_conf *mdev, union drbd_state os,
 	 * which is unexpected. */
 	if ((os.conn != C_SYNC_SOURCE && os.conn != C_PAUSED_SYNC_S) &&
 	    (ns.conn == C_SYNC_SOURCE || ns.conn == C_PAUSED_SYNC_S) &&
-	    mdev->agreed_pro_version >= 96 && get_ldev(mdev)) {
+	    mdev->tconn->agreed_pro_version >= 96 && get_ldev(mdev)) {
 		drbd_gen_and_send_sync_uuid(mdev);
 		put_ldev(mdev);
 	}
@@ -1902,7 +1902,7 @@ int drbd_send_sync_param(struct drbd_conf *mdev, struct syncer_conf *sc)
 	struct p_rs_param_95 *p;
 	struct socket *sock;
 	int size, rv;
-	const int apv = mdev->agreed_pro_version;
+	const int apv = mdev->tconn->agreed_pro_version;
 
 	size = apv <= 87 ? sizeof(struct p_rs_param)
 		: apv == 88 ? sizeof(struct p_rs_param)
@@ -1951,7 +1951,7 @@ int drbd_send_protocol(struct drbd_conf *mdev)
 
 	size = sizeof(struct p_protocol);
 
-	if (mdev->agreed_pro_version >= 87)
+	if (mdev->tconn->agreed_pro_version >= 87)
 		size += strlen(mdev->tconn->net_conf->integrity_alg) + 1;
 
 	/* we must not recurse into our own queue,
@@ -1970,7 +1970,7 @@ int drbd_send_protocol(struct drbd_conf *mdev)
 	if (mdev->tconn->net_conf->want_lose)
 		cf |= CF_WANT_LOSE;
 	if (mdev->tconn->net_conf->dry_run) {
-		if (mdev->agreed_pro_version >= 92)
+		if (mdev->tconn->agreed_pro_version >= 92)
 			cf |= CF_DRY_RUN;
 		else {
 			dev_err(DEV, "--dry-run is not supported by peer");
@@ -1980,7 +1980,7 @@ int drbd_send_protocol(struct drbd_conf *mdev)
 	}
 	p->conn_flags    = cpu_to_be32(cf);
 
-	if (mdev->agreed_pro_version >= 87)
+	if (mdev->tconn->agreed_pro_version >= 87)
 		strcpy(p->integrity_alg, mdev->tconn->net_conf->integrity_alg);
 
 	rv = drbd_send_cmd(mdev, USE_DATA_SOCKET, P_PROTOCOL,
@@ -2158,7 +2158,7 @@ int fill_bitmap_rle_bits(struct drbd_conf *mdev,
 
 	/* may we use this feature? */
 	if ((mdev->sync_conf.use_rle == 0) ||
-		(mdev->agreed_pro_version < 90))
+		(mdev->tconn->agreed_pro_version < 90))
 			return 0;
 
 	if (c->bit_offset >= c->bm_bits)
@@ -2404,7 +2404,7 @@ static int _drbd_send_ack(struct drbd_conf *mdev, enum drbd_packets cmd,
 int drbd_send_ack_dp(struct drbd_conf *mdev, enum drbd_packets cmd,
 		     struct p_data *dp, int data_size)
 {
-	data_size -= (mdev->agreed_pro_version >= 87 && mdev->integrity_r_tfm) ?
+	data_size -= (mdev->tconn->agreed_pro_version >= 87 && mdev->integrity_r_tfm) ?
 		crypto_hash_digestsize(mdev->integrity_r_tfm) : 0;
 	return _drbd_send_ack(mdev, cmd, dp->sector, cpu_to_be32(data_size),
 			      dp->block_id);
@@ -2514,10 +2514,10 @@ static int we_should_drop_the_connection(struct drbd_conf *mdev, struct socket *
 	if (drop_it)
 		return true;
 
-	drop_it = !--mdev->ko_count;
+	drop_it = !--mdev->tconn->ko_count;
 	if (!drop_it) {
 		dev_err(DEV, "[%s/%d] sock_sendmsg time expired, ko = %u\n",
-		       current->comm, current->pid, mdev->ko_count);
+		       current->comm, current->pid, mdev->tconn->ko_count);
 		request_ping(mdev);
 	}
 
@@ -2647,7 +2647,7 @@ static int _drbd_send_zc_ee(struct drbd_conf *mdev, struct drbd_epoch_entry *e)
 
 static u32 bio_flags_to_wire(struct drbd_conf *mdev, unsigned long bi_rw)
 {
-	if (mdev->agreed_pro_version >= 95)
+	if (mdev->tconn->agreed_pro_version >= 95)
 		return  (bi_rw & REQ_SYNC ? DP_RW_SYNC : 0) |
 			(bi_rw & REQ_FUA ? DP_FUA : 0) |
 			(bi_rw & REQ_FLUSH ? DP_FLUSH : 0) |
@@ -2670,7 +2670,7 @@ int drbd_send_dblock(struct drbd_conf *mdev, struct drbd_request *req)
 	if (!drbd_get_data_sock(mdev))
 		return 0;
 
-	dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_w_tfm) ?
+	dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->integrity_w_tfm) ?
 		crypto_hash_digestsize(mdev->integrity_w_tfm) : 0;
 
 	if (req->i.size <= DRBD_MAX_SIZE_H80_PACKET) {
@@ -2755,7 +2755,7 @@ int drbd_send_block(struct drbd_conf *mdev, enum drbd_packets cmd,
 	void *dgb;
 	int dgs;
 
-	dgs = (mdev->agreed_pro_version >= 87 && mdev->integrity_w_tfm) ?
+	dgs = (mdev->tconn->agreed_pro_version >= 87 && mdev->integrity_w_tfm) ?
 		crypto_hash_digestsize(mdev->integrity_w_tfm) : 0;
 
 	if (e->i.size <= DRBD_MAX_SIZE_H80_PACKET) {
@@ -2843,7 +2843,7 @@ int drbd_send(struct drbd_conf *mdev, struct socket *sock,
 	msg.msg_flags      = msg_flags | MSG_NOSIGNAL;
 
 	if (sock == mdev->tconn->data.socket) {
-		mdev->ko_count = mdev->tconn->net_conf->ko_count;
+		mdev->tconn->ko_count = mdev->tconn->net_conf->ko_count;
 		drbd_update_congested(mdev);
 	}
 	do {
@@ -3038,7 +3038,7 @@ void drbd_init_set_defaults(struct drbd_conf *mdev)
 	drbd_thread_init(mdev, &mdev->tconn->worker, drbd_worker);
 	drbd_thread_init(mdev, &mdev->tconn->asender, drbd_asender);
 
-	mdev->agreed_pro_version = PRO_VERSION_MAX;
+	mdev->tconn->agreed_pro_version = PRO_VERSION_MAX;
 	mdev->write_ordering = WO_bdev_flush;
 	mdev->resync_wenr = LC_FREE;
 	mdev->peer_max_bio_size = DRBD_MAX_BIO_SIZE_SAFE;
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 59bb58c..a9ede8fc 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -845,9 +845,9 @@ void drbd_reconsider_max_bio_size(struct drbd_conf *mdev)
 	   Because new from 8.3.8 onwards the peer can use multiple
 	   BIOs for a single peer_request */
 	if (mdev->state.conn >= C_CONNECTED) {
-		if (mdev->agreed_pro_version < 94)
+		if (mdev->tconn->agreed_pro_version < 94)
 			peer = mdev->peer_max_bio_size;
-		else if (mdev->agreed_pro_version == 94)
+		else if (mdev->tconn->agreed_pro_version == 94)
 			peer = DRBD_MAX_SIZE_H80_PACKET;
 		else /* drbd 8.3.8 onwards */
 			peer = DRBD_MAX_BIO_SIZE;
@@ -1675,7 +1675,7 @@ static int drbd_nl_resize(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nlp,
 		goto fail;
 	}
 
-	if (rs.no_resync && mdev->agreed_pro_version < 93) {
+	if (rs.no_resync && mdev->tconn->agreed_pro_version < 93) {
 		retcode = ERR_NEED_APV_93;
 		goto fail;
 	}
@@ -2170,7 +2170,7 @@ static int drbd_nl_new_c_uuid(struct drbd_conf *mdev, struct drbd_nl_cfg_req *nl
 	}
 
 	/* this is "skip initial sync", assume to be clean */
-	if (mdev->state.conn == C_CONNECTED && mdev->agreed_pro_version >= 90 &&
+	if (mdev->state.conn == C_CONNECTED && mdev->tconn->agreed_pro_version >= 90 &&
 	    mdev->ldev->md.uuid[UI_CURRENT] == UUID_JUST_CREATED && args.clear_bm) {
 		dev_info(DEV, "Preparing to skip initial sync\n");
 		skip_initial_sync = 1;
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index e9f670c..27a8363 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -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;
diff --git a/drivers/block/drbd/drbd_req.c b/drivers/block/drbd/drbd_req.c
index ac43e44..c871ef2 100644
--- a/drivers/block/drbd/drbd_req.c
+++ b/drivers/block/drbd/drbd_req.c
@@ -951,7 +951,7 @@ allocate_barrier:
 		_req_mod(req, QUEUE_FOR_SEND_OOS);
 
 	if (remote &&
-	    mdev->tconn->net_conf->on_congestion != OC_BLOCK && mdev->agreed_pro_version >= 96) {
+	    mdev->tconn->net_conf->on_congestion != OC_BLOCK && mdev->tconn->agreed_pro_version >= 96) {
 		int congested = 0;
 
 		if (mdev->tconn->net_conf->cong_fill &&
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c
index 1ca7856..ec26df3 100644
--- a/drivers/block/drbd/drbd_worker.c
+++ b/drivers/block/drbd/drbd_worker.c
@@ -616,7 +616,7 @@ next_sector:
 		/* adjust very last sectors, in case we are oddly sized */
 		if (sector + (size>>9) > capacity)
 			size = (capacity-sector)<<9;
-		if (mdev->agreed_pro_version >= 89 && mdev->csums_tfm) {
+		if (mdev->tconn->agreed_pro_version >= 89 && mdev->csums_tfm) {
 			switch (read_for_csum(mdev, sector, size)) {
 			case -EIO: /* Disk failure */
 				put_ldev(mdev);
@@ -1574,10 +1574,10 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
 		 * drbd_resync_finished from here in that case.
 		 * We drbd_gen_and_send_sync_uuid here for protocol < 96,
 		 * and from after_state_ch otherwise. */
-		if (side == C_SYNC_SOURCE && mdev->agreed_pro_version < 96)
+		if (side == C_SYNC_SOURCE && mdev->tconn->agreed_pro_version < 96)
 			drbd_gen_and_send_sync_uuid(mdev);
 
-		if (mdev->agreed_pro_version < 95 && mdev->rs_total == 0) {
+		if (mdev->tconn->agreed_pro_version < 95 && mdev->rs_total == 0) {
 			/* This still has a race (about when exactly the peers
 			 * detect connection loss) that can lead to a full sync
 			 * on next handshake. In 8.3.9 we fixed this with explicit
-- 
1.7.4.1


  parent reply	other threads:[~2011-08-25 15:09 UTC|newest]

Thread overview: 132+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 15:06 [RFC 000/118] drbd: part 1 of adding multiple volume support to drbd Philipp Reisner
2011-08-25 15:06 ` [PATCH 001/118] drbd: Get rid of req_validator_fn typedef Philipp Reisner
2011-08-25 15:06 ` [PATCH 002/118] drbd: Remove superfluous declaration Philipp Reisner
2011-08-25 15:06 ` [PATCH 003/118] drbd: Consistently use block_id == ID_SYNCER for checksum based resync and online verify Philipp Reisner
2011-08-25 15:07 ` [PATCH 004/118] drbd: Get rid of BE_DRBD_MAGIC and BE_DRBD_MAGIC_BIG Philipp Reisner
2011-08-25 15:07 ` [PATCH 005/118] drbd: Endianness convert the constants instead of the variables Philipp Reisner
2011-08-25 15:07 ` [PATCH 006/118] drbd: Magic reserved block_id value cleanup Philipp Reisner
2011-08-25 15:07 ` [PATCH 007/118] drbd: Move drbd_free_tl_hash() to drbd_main() Philipp Reisner
2011-08-25 15:07 ` [PATCH 008/118] drbd: Update outdated comment Philipp Reisner
2011-08-25 15:07 ` [PATCH 009/118] drbd: Request lookup code cleanup (1) Philipp Reisner
2011-08-25 15:07 ` [PATCH 010/118] drbd: Request lookup code cleanup (2) Philipp Reisner
2011-08-25 15:07 ` [PATCH 011/118] drbd: Request lookup code cleanup (3) Philipp Reisner
2011-08-25 15:07 ` [PATCH 012/118] drbd: Request lookup code cleanup (4) Philipp Reisner
2011-08-25 15:07 ` [PATCH 013/118] drbd: Add interval tree data structure Philipp Reisner
2011-08-25 15:07 ` [PATCH 014/118] drbd: Put sector and size in struct drbd_request into struct drbd_interval Philipp Reisner
2011-08-25 15:07 ` [PATCH 015/118] drbd: Use interval tree for overlapping write request detection Philipp Reisner
2011-08-25 15:07 ` [PATCH 016/118] drbd: Add read_requests tree Philipp Reisner
2011-08-25 18:02   ` [Drbd-dev] " Pawel Jakub Dawidek
2011-08-29 11:42     ` Philipp Reisner
2011-08-25 15:07 ` [PATCH 017/118] drbd: Use the read and write request trees for request lookups Philipp Reisner
2011-08-25 15:07 ` [PATCH 018/118] drbd: Put sector and size in struct drbd_epoch_entry into struct drbd_interval Philipp Reisner
2011-08-25 15:07 ` [PATCH 019/118] drbd: Use interval tree for overlapping epoch entry detection Philipp Reisner
2011-08-25 15:07 ` [PATCH 020/118] drbd: Remove the unused hash tables Philipp Reisner
2011-08-25 15:07 ` [PATCH 021/118] drbd: Convert all constants in enum drbd_req_event to upper case Philipp Reisner
2011-08-25 15:07 ` [PATCH 022/118] drbd: Convert all constants in enum drbd_thread_state " Philipp Reisner
2011-08-25 15:07 ` [PATCH 023/118] drbd: Replace the ERR_IF macro with an assert-like macro Philipp Reisner
2011-08-25 15:07 ` [PATCH 024/118] drbd: Remove some useless paranoia code Philipp Reisner
2011-08-25 15:07 ` [PATCH 025/118] drbd: Inline function overlaps() is now unused Philipp Reisner
2011-08-25 15:07 ` [PATCH 026/118] drbd: Interval tree bugfix Philipp Reisner
2011-08-25 15:07 ` [PATCH 027/118] idr: idr_for_each_entry() macro Philipp Reisner
2011-08-25 15:07 ` [PATCH 028/118] drbd: Minimal struct drbd_tconn Philipp Reisner
2011-08-25 15:07 ` [PATCH 029/118] drbd: moved net_conf from mdev to tconn Philipp Reisner
2011-08-25 15:07 ` [PATCH 030/118] drbd: moved net_cont and net_cnt_wait " Philipp Reisner
2011-08-25 15:07 ` [PATCH 031/118] drbd: moved data and meta " Philipp Reisner
2011-08-25 15:07 ` [PATCH 032/118] drbd: moved receiver, worker and asender " Philipp Reisner
2011-08-25 15:07 ` Philipp Reisner [this message]
2011-08-25 15:07 ` [PATCH 034/118] drbd: moved req_lock and transfer log " Philipp Reisner
2011-08-25 15:07 ` [PATCH 035/118] drbd: moved crypto transformations and friends " Philipp Reisner
2011-08-25 15:07 ` [PATCH 036/118] drbd: Made drbd_flush_workqueue() to take a tconn instead of an mdev Philipp Reisner
2011-08-25 15:07 ` [PATCH 037/118] drbd: Preparing to use p_header96 for all packets Philipp Reisner
2011-08-25 15:07 ` [PATCH 038/118] drbd: Replaced all p_header80 with a generic p_header Philipp Reisner
2011-08-25 15:07 ` [PATCH 039/118] drbd: Use new header layout, and send volume IOs Philipp Reisner
2011-08-25 15:07 ` [PATCH 040/118] drbd: Implemented receiving of new style packets on meta socket Philipp Reisner
2011-08-25 15:07 ` [PATCH 041/118] drbd: Do not access tconn after it was freed Philipp Reisner
2011-08-25 15:07 ` [PATCH 042/118] drbd: Move cmdname() out of drbd_int.h Philipp Reisner
2011-08-25 15:07 ` [PATCH 043/118] drbd: Rename "enum drbd_packets" to "enum drbd_packet" Philipp Reisner
2011-08-25 15:07 ` [PATCH 044/118] drbd: Remove redundant initialization Philipp Reisner
2011-08-25 15:07 ` [PATCH 045/118] drbd: Initialize the sequence number sent over the network even when not used Philipp Reisner
2011-08-25 15:07 ` [PATCH 046/118] drbd: Move sequence number logic into drbd_receiver.c and simplify it Philipp Reisner
2011-08-25 15:07 ` [PATCH 047/118] drbd: Move some functions to where they are used Philipp Reisner
2011-08-25 15:07 ` [PATCH 048/118] drbd: struct drbd_request: Introduce a new collision flag Philipp Reisner
2011-08-25 15:07 ` [PATCH 049/118] drbd: Remove redundant check from drbd_contains_interval() Philipp Reisner
2011-08-25 15:07 ` [PATCH 050/118] drbd: Allow to wait for the completion of an epoch entry as well Philipp Reisner
2011-08-25 15:07 ` [PATCH 051/118] drbd: _req_conflicts(): Get rid of the epoch_entries tree Philipp Reisner
2011-08-25 15:07 ` [PATCH 052/118] drbd: Remove unnecessary reference counting left-over Philipp Reisner
2011-08-25 15:07 ` [PATCH 053/118] drbd: Defer new writes when detecting conflicting writes Philipp Reisner
2011-08-25 15:07 ` [PATCH 054/118] drbd: Make the peer_seq updating code more obvious Philipp Reisner
2011-08-25 15:07 ` [PATCH 055/118] drbd: Improve the drbd_find_overlap() documentation Philipp Reisner
2011-08-25 15:07 ` [PATCH 056/118] drbd: Remove unused variable in struct drbd_conf Philipp Reisner
2011-08-25 15:07 ` [PATCH 057/118] drbd: Rename struct drbd_epoch_entry to struct drbd_peer_request Philipp Reisner
2011-08-25 15:07 ` [PATCH 058/118] drbd: Clean up some left-overs Philipp Reisner
2011-08-25 15:07 ` [PATCH 059/118] drbd: Update some comments Philipp Reisner
2011-08-25 15:07 ` [PATCH 060/118] drbd: Local variable renames: e -> peer_req Philipp Reisner
2011-08-25 15:07 ` [PATCH 061/118] drbd: Moved the state functions into its own source file Philipp Reisner
2011-08-25 15:07 ` [PATCH 062/118] drbd: Moved the thread name into the data structure Philipp Reisner
2011-08-25 15:07 ` [PATCH 063/118] drbd: Eliminated the user of drbd_task_to_thread() Philipp Reisner
2011-08-25 15:08 ` [PATCH 064/118] drbd: Moved code Philipp Reisner
2011-08-25 15:08 ` [PATCH 065/118] drbd: Do no sleep long in drbd_start_resync Philipp Reisner
2011-08-25 15:08 ` [PATCH 066/118] drbd: Revert "Make sure we dont send state if a cluster wide state change is in progress" Philipp Reisner
2011-08-25 15:08 ` [PATCH 067/118] drbd: Moving state related macros to drbd_state.h Philipp Reisner
2011-08-25 15:08 ` [PATCH 068/118] drbd: conn_printk() a dev_printk() alike for drbd's connections Philipp Reisner
2011-08-25 18:16   ` Joe Perches
2011-08-29 11:42     ` [Drbd-dev] " Philipp Reisner
2011-08-25 15:08 ` [PATCH 069/118] drbd: Converted drbd_try_connect() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 070/118] drbd: Converted drbd_wait_for_connect() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 071/118] drbd: Started to separated connection flags (tconn) from block device flags (mdev) Philipp Reisner
2011-08-25 15:08 ` [PATCH 072/118] drbd: Moved DISCARD_CONCURRENT to the per connection (tconn) flags Philipp Reisner
2011-08-25 15:08 ` [PATCH 073/118] drbd: Moved SEND_PING " Philipp Reisner
2011-08-25 15:08 ` [PATCH 074/118] drbd: Moved SIGNAL_ASENDER " Philipp Reisner
2011-08-25 15:08 ` [PATCH 075/118] drbd: Converted wake_asender() and request_ping() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 076/118] drbd: Converted helper functions for drbd_send() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 077/118] drbd: Converted drbd_send() from mdev " Philipp Reisner
2011-08-25 15:08 ` [PATCH 078/118] drbd: Converted drbd_send_fp() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 079/118] drbd: Removed unused mdev argument from drbd_recv_short() and drbd_socket_okay() Philipp Reisner
2011-08-25 15:08 ` [PATCH 080/118] drbd: Converted drbd_recv_fp() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 081/118] drbd: Converted drbd_send_handshake() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 082/118] drbd: Converted drbd_recv() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 083/118] drbd: struct packet_info to hold information of decoded packets Philipp Reisner
2011-08-25 15:08 ` [PATCH 084/118] drbd: Converted decode_header() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 085/118] drbd: Converted drbd_recv_header() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 086/118] drbd: Converted drbd_do_handshake() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 087/118] drbd: Converted drbd_(get|put)_data_sock() and drbd_send_cmd2() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 088/118] drbd: Converted drbd_do_auth() from mdev " Philipp Reisner
2011-08-25 15:08 ` [PATCH 089/118] drbd: Converted drbd_send_protocol() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 090/118] drbd: Use and idr data structure to map volume numbers to mdev pointers Philipp Reisner
2011-08-25 15:08 ` [PATCH 091/118] drbd: Converted drbd_connect() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 092/118] drbd: Converted drbd_calc_cpu_mask() and drbd_thread_current_set_cpu() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 093/118] drbd: Converted drbdd() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 094/118] drbd: Converted drbd_free_sock() and drbd_disconnect() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 095/118] drbd: Moved the mdev member into drbd_work (from drbd_request and drbd_peer_request) Philipp Reisner
2011-08-25 15:08 ` [PATCH 096/118] drbd: Consolidated the setup of the thread name into the framework Philipp Reisner
2011-08-25 15:08 ` [PATCH 097/118] drbd: Converted drbdd_init() from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 098/118] drbd: Converted drbd_asender() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 099/118] drbd: Converted drbd_worker() " Philipp Reisner
2011-08-25 15:08 ` [PATCH 100/118] drbd: drbd_thread has now a pointer to a tconn instead of to a mdev Philipp Reisner
2011-08-25 15:08 ` [PATCH 101/118] drbd: Moved some initializing code into drbd_new_tconn() Philipp Reisner
2011-08-25 15:08 ` [PATCH 102/118] drbd: Generalized the work callbacks Philipp Reisner
2011-08-25 15:08 ` [PATCH 103/118] drbd: Converted drbd_send_ping() and related functions from mdev to tconn Philipp Reisner
2011-08-25 15:08 ` [PATCH 104/118] drbd: Extracted after_conn_state_ch() out of after_state_ch() Philipp Reisner
2011-08-25 15:08 ` [PATCH 105/118] drbd: Renamed is_valid_state_transition() to is_valid_soft_transition() Philipp Reisner
2011-08-25 15:08 ` [PATCH 106/118] drbd: Extracted is_valid_transition() out of sanitize_state() Philipp Reisner
2011-08-25 15:08 ` [PATCH 107/118] drbd: Extracted is_valid_conn_transition() out of is_valid_transition() Philipp Reisner
2011-08-25 15:08 ` [PATCH 108/118] drbd: Removed the os parameter form sanitize_state() Philipp Reisner
2011-08-25 15:08 ` [PATCH 109/118] drbd: Code de-duplication; new function apply_mask_val() Philipp Reisner
2011-08-25 15:08 ` [PATCH 110/118] drbd: Killed volume0; last step of multi-volume-enablement Philipp Reisner
2011-08-25 15:08 ` [PATCH 111/118] drbd: Removed drbd_state_lock() and drbd_state_unlock() Philipp Reisner
2011-08-25 15:08 ` [PATCH 112/118] drbd: Introduced tconn->cstate_mutex Philipp Reisner
2011-08-25 15:08 ` [PATCH 113/118] drbd: Implemented conn_send_state_req() Philipp Reisner
2011-08-25 15:08 ` [PATCH 114/118] drbd: Global_state_lock not necessary here Philipp Reisner
2011-08-25 15:08 ` [PATCH 115/118] drbd: Implemented conn_send_sr_reply() Philipp Reisner
2011-08-25 15:08 ` [PATCH 116/118] drbd: Implemented receiving of P_CONN_ST_CHG_REPLY Philipp Reisner
2011-08-25 15:08 ` [PATCH 117/118] drbd: implemented receiving of P_CONN_ST_CHG_REQ Philipp Reisner
2011-08-25 15:08 ` [PATCH 118/118] drbd: Implemented connection wide state changes Philipp Reisner
2011-08-26  1:30 ` [RFC 000/118] drbd: part 1 of adding multiple volume support to drbd David Miller
     [not found] ` <CAGpXXZKem-uEdF4SyUgpQFV6=d5Vo3v9p3wmcaygAKa4w4x01w@mail.gmail.com>
2011-08-26 13:54   ` [Drbd-dev] " Lars Ellenberg
2011-08-26 15:18     ` Kyle Moffett
2011-08-29 11:51       ` Philipp Reisner
2011-08-29 12:52         ` Pekka Enberg
2011-08-29 15:38           ` Philipp Reisner
2011-08-29 11:46   ` Philipp Reisner
2011-08-29 13:26     ` Greg Freemyer
2011-08-29 16:07       ` Philipp Reisner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1314284934-17999-34-git-send-email-philipp.reisner@linbit.com \
    --to=philipp.reisner@linbit.com \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®