aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd
diff options
context:
space:
mode:
authorLars Ellenberg <lars.ellenberg@linbit.com>2012-08-01 06:43:01 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2012-11-09 08:05:49 -0500
commit427c0434fc52f15bd762ddc6611e874df6cc5b8d (patch)
tree5d83c132fd0809884f5199a48ec6bbb9c7690ece /drivers/block/drbd
parentd4dabbe22d38752674c582e5bb40716a72397355 (diff)
drbd: disambiguation, s/DISCARD_CONCURRENT/RESOLVE_CONFLICTS/
We don't discard anything here, really. We resolve conflicting, concurrent writes to overlapping data blocks. Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r--drivers/block/drbd/drbd_int.h2
-rw-r--r--drivers/block/drbd/drbd_nl.c2
-rw-r--r--drivers/block/drbd/drbd_receiver.c20
3 files changed, 12 insertions, 12 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 91b73247f65d..813f50dbe5ca 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -799,7 +799,7 @@ extern struct fifo_buffer *fifo_alloc(int fifo_size);
799/* flag bits per tconn */ 799/* flag bits per tconn */
800enum { 800enum {
801 NET_CONGESTED, /* The data socket is congested */ 801 NET_CONGESTED, /* The data socket is congested */
802 DISCARD_CONCURRENT, /* Set on one node, cleared on the peer! */ 802 RESOLVE_CONFLICTS, /* Set on one node, cleared on the peer! */
803 SEND_PING, /* whether asender should send a ping asap */ 803 SEND_PING, /* whether asender should send a ping asap */
804 SIGNAL_ASENDER, /* whether asender wants to be interrupted */ 804 SIGNAL_ASENDER, /* whether asender wants to be interrupted */
805 GOT_PING_ACK, /* set when we receive a ping_ack packet, ping_wait gets woken */ 805 GOT_PING_ACK, /* set when we receive a ping_ack packet, ping_wait gets woken */
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 466d6b1d9309..35bb572a2076 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -2249,7 +2249,7 @@ void resync_after_online_grow(struct drbd_conf *mdev)
2249 if (mdev->state.role != mdev->state.peer) 2249 if (mdev->state.role != mdev->state.peer)
2250 iass = (mdev->state.role == R_PRIMARY); 2250 iass = (mdev->state.role == R_PRIMARY);
2251 else 2251 else
2252 iass = test_bit(DISCARD_CONCURRENT, &mdev->tconn->flags); 2252 iass = test_bit(RESOLVE_CONFLICTS, &mdev->tconn->flags);
2253 2253
2254 if (iass) 2254 if (iass)
2255 drbd_start_resync(mdev, C_SYNC_SOURCE); 2255 drbd_start_resync(mdev, C_SYNC_SOURCE);
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c
index afab66bbc31f..99121076bf12 100644
--- a/drivers/block/drbd/drbd_receiver.c
+++ b/drivers/block/drbd/drbd_receiver.c
@@ -916,7 +916,7 @@ static int conn_connect(struct drbd_tconn *tconn)
916 sock.socket = s; 916 sock.socket = s;
917 send_first_packet(tconn, &sock, P_INITIAL_DATA); 917 send_first_packet(tconn, &sock, P_INITIAL_DATA);
918 } else if (!msock.socket) { 918 } else if (!msock.socket) {
919 clear_bit(DISCARD_CONCURRENT, &tconn->flags); 919 clear_bit(RESOLVE_CONFLICTS, &tconn->flags);
920 msock.socket = s; 920 msock.socket = s;
921 send_first_packet(tconn, &msock, P_INITIAL_META); 921 send_first_packet(tconn, &msock, P_INITIAL_META);
922 } else { 922 } else {
@@ -954,7 +954,7 @@ retry:
954 sock.socket = s; 954 sock.socket = s;
955 break; 955 break;
956 case P_INITIAL_META: 956 case P_INITIAL_META:
957 set_bit(DISCARD_CONCURRENT, &tconn->flags); 957 set_bit(RESOLVE_CONFLICTS, &tconn->flags);
958 if (msock.socket) { 958 if (msock.socket) {
959 conn_warn(tconn, "initial packet M crossed\n"); 959 conn_warn(tconn, "initial packet M crossed\n");
960 sock_release(msock.socket); 960 sock_release(msock.socket);
@@ -1899,7 +1899,7 @@ static bool need_peer_seq(struct drbd_conf *mdev)
1899 1899
1900 /* 1900 /*
1901 * We only need to keep track of the last packet_seq number of our peer 1901 * We only need to keep track of the last packet_seq number of our peer
1902 * if we are in dual-primary mode and we have the discard flag set; see 1902 * if we are in dual-primary mode and we have the resolve-conflicts flag set; see
1903 * handle_write_conflicts(). 1903 * handle_write_conflicts().
1904 */ 1904 */
1905 1905
@@ -1907,7 +1907,7 @@ static bool need_peer_seq(struct drbd_conf *mdev)
1907 tp = rcu_dereference(mdev->tconn->net_conf)->two_primaries; 1907 tp = rcu_dereference(mdev->tconn->net_conf)->two_primaries;
1908 rcu_read_unlock(); 1908 rcu_read_unlock();
1909 1909
1910 return tp && test_bit(DISCARD_CONCURRENT, &tconn->flags); 1910 return tp && test_bit(RESOLVE_CONFLICTS, &tconn->flags);
1911} 1911}
1912 1912
1913static void update_peer_seq(struct drbd_conf *mdev, unsigned int peer_seq) 1913static void update_peer_seq(struct drbd_conf *mdev, unsigned int peer_seq)
@@ -2048,7 +2048,7 @@ static int handle_write_conflicts(struct drbd_conf *mdev,
2048 struct drbd_peer_request *peer_req) 2048 struct drbd_peer_request *peer_req)
2049{ 2049{
2050 struct drbd_tconn *tconn = mdev->tconn; 2050 struct drbd_tconn *tconn = mdev->tconn;
2051 bool resolve_conflicts = test_bit(DISCARD_CONCURRENT, &tconn->flags); 2051 bool resolve_conflicts = test_bit(RESOLVE_CONFLICTS, &tconn->flags);
2052 sector_t sector = peer_req->i.sector; 2052 sector_t sector = peer_req->i.sector;
2053 const unsigned int size = peer_req->i.size; 2053 const unsigned int size = peer_req->i.size;
2054 struct drbd_interval *i; 2054 struct drbd_interval *i;
@@ -2600,7 +2600,7 @@ static int drbd_asb_recover_0p(struct drbd_conf *mdev) __must_hold(local)
2600 "Using discard-least-changes instead\n"); 2600 "Using discard-least-changes instead\n");
2601 case ASB_DISCARD_ZERO_CHG: 2601 case ASB_DISCARD_ZERO_CHG:
2602 if (ch_peer == 0 && ch_self == 0) { 2602 if (ch_peer == 0 && ch_self == 0) {
2603 rv = test_bit(DISCARD_CONCURRENT, &mdev->tconn->flags) 2603 rv = test_bit(RESOLVE_CONFLICTS, &mdev->tconn->flags)
2604 ? -1 : 1; 2604 ? -1 : 1;
2605 break; 2605 break;
2606 } else { 2606 } else {
@@ -2616,7 +2616,7 @@ static int drbd_asb_recover_0p(struct drbd_conf *mdev) __must_hold(local)
2616 rv = 1; 2616 rv = 1;
2617 else /* ( ch_self == ch_peer ) */ 2617 else /* ( ch_self == ch_peer ) */
2618 /* Well, then use something else. */ 2618 /* Well, then use something else. */
2619 rv = test_bit(DISCARD_CONCURRENT, &mdev->tconn->flags) 2619 rv = test_bit(RESOLVE_CONFLICTS, &mdev->tconn->flags)
2620 ? -1 : 1; 2620 ? -1 : 1;
2621 break; 2621 break;
2622 case ASB_DISCARD_LOCAL: 2622 case ASB_DISCARD_LOCAL:
@@ -2839,7 +2839,7 @@ static int drbd_uuid_compare(struct drbd_conf *mdev, int *rule_nr) __must_hold(l
2839 case 1: /* self_pri && !peer_pri */ return 1; 2839 case 1: /* self_pri && !peer_pri */ return 1;
2840 case 2: /* !self_pri && peer_pri */ return -1; 2840 case 2: /* !self_pri && peer_pri */ return -1;
2841 case 3: /* self_pri && peer_pri */ 2841 case 3: /* self_pri && peer_pri */
2842 dc = test_bit(DISCARD_CONCURRENT, &mdev->tconn->flags); 2842 dc = test_bit(RESOLVE_CONFLICTS, &mdev->tconn->flags);
2843 return dc ? -1 : 1; 2843 return dc ? -1 : 1;
2844 } 2844 }
2845 } 2845 }
@@ -3775,7 +3775,7 @@ static int receive_req_state(struct drbd_tconn *tconn, struct packet_info *pi)
3775 mask.i = be32_to_cpu(p->mask); 3775 mask.i = be32_to_cpu(p->mask);
3776 val.i = be32_to_cpu(p->val); 3776 val.i = be32_to_cpu(p->val);
3777 3777
3778 if (test_bit(DISCARD_CONCURRENT, &mdev->tconn->flags) && 3778 if (test_bit(RESOLVE_CONFLICTS, &mdev->tconn->flags) &&
3779 mutex_is_locked(mdev->state_mutex)) { 3779 mutex_is_locked(mdev->state_mutex)) {
3780 drbd_send_sr_reply(mdev, SS_CONCURRENT_ST_CHG); 3780 drbd_send_sr_reply(mdev, SS_CONCURRENT_ST_CHG);
3781 return 0; 3781 return 0;
@@ -3801,7 +3801,7 @@ static int receive_req_conn_state(struct drbd_tconn *tconn, struct packet_info *
3801 mask.i = be32_to_cpu(p->mask); 3801 mask.i = be32_to_cpu(p->mask);
3802 val.i = be32_to_cpu(p->val); 3802 val.i = be32_to_cpu(p->val);
3803 3803
3804 if (test_bit(DISCARD_CONCURRENT, &tconn->flags) && 3804 if (test_bit(RESOLVE_CONFLICTS, &tconn->flags) &&
3805 mutex_is_locked(&tconn->cstate_mutex)) { 3805 mutex_is_locked(&tconn->cstate_mutex)) {
3806 conn_send_sr_reply(tconn, SS_CONCURRENT_ST_CHG); 3806 conn_send_sr_reply(tconn, SS_CONCURRENT_ST_CHG);
3807 return 0; 3807 return 0;