提交 6139f60d 编写于 作者: A Andreas Gruenbacher 提交者: Philipp Reisner

drbd: Rename the want_lose field/flag to discard_my_data

This is what it is called in config files and on the command line as
well.
Signed-off-by: NPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: NLars Ellenberg <lars.ellenberg@linbit.com>
上级 7bac3e6f
......@@ -413,7 +413,7 @@ struct p_rs_param_95 {
} __packed;
enum drbd_conn_flags {
CF_WANT_LOSE = 1,
CF_DISCARD_MY_DATA = 1,
CF_DRY_RUN = 2,
};
......
......@@ -943,8 +943,8 @@ int __drbd_send_protocol(struct drbd_tconn *tconn)
p->after_sb_2p = cpu_to_be32(nc->after_sb_2p);
p->two_primaries = cpu_to_be32(nc->two_primaries);
cf = 0;
if (nc->want_lose)
cf |= CF_WANT_LOSE;
if (nc->discard_my_data)
cf |= CF_DISCARD_MY_DATA;
if (nc->dry_run)
cf |= CF_DRY_RUN;
p->conn_flags = cpu_to_be32(cf);
......@@ -988,7 +988,7 @@ int _drbd_send_uuids(struct drbd_conf *mdev, u64 uuid_flags)
mdev->comm_bm_set = drbd_bm_total_weight(mdev);
p->uuid[UI_SIZE] = cpu_to_be64(mdev->comm_bm_set);
rcu_read_lock();
uuid_flags |= rcu_dereference(mdev->tconn->net_conf)->want_lose ? 1 : 0;
uuid_flags |= rcu_dereference(mdev->tconn->net_conf)->discard_my_data ? 1 : 0;
rcu_read_unlock();
uuid_flags |= test_bit(CRASHED_PRIMARY, &mdev->flags) ? 2 : 0;
uuid_flags |= mdev->new_state_tmp.disk == D_INCONSISTENT ? 4 : 0;
......
......@@ -606,7 +606,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force)
mutex_lock(&mdev->tconn->conf_update);
nc = mdev->tconn->net_conf;
if (nc)
nc->want_lose = 0; /* without copy; single bit op is atomic */
nc->discard_my_data = 0; /* without copy; single bit op is atomic */
mutex_unlock(&mdev->tconn->conf_update);
set_disk_ro(mdev->vdisk, false);
......@@ -1738,7 +1738,7 @@ _check_net_options(struct drbd_tconn *tconn, struct net_conf *old_conf, struct n
if (new_conf->wire_protocol == DRBD_PROT_A && fp == FP_STONITH)
return ERR_STONITH_AND_PROT_A;
}
if (mdev->state.role == R_PRIMARY && new_conf->want_lose)
if (mdev->state.role == R_PRIMARY && new_conf->discard_my_data)
return ERR_DISCARD;
}
......
......@@ -2908,9 +2908,9 @@ static enum drbd_conns drbd_sync_handshake(struct drbd_conf *mdev, enum drbd_rol
}
if (hg == -100) {
if (nc->want_lose && !(mdev->p_uuid[UI_FLAGS]&1))
if (nc->discard_my_data && !(mdev->p_uuid[UI_FLAGS]&1))
hg = -1;
if (!nc->want_lose && (mdev->p_uuid[UI_FLAGS]&1))
if (!nc->discard_my_data && (mdev->p_uuid[UI_FLAGS]&1))
hg = 1;
if (abs(hg) < 100)
......@@ -3009,7 +3009,7 @@ static int receive_protocol(struct drbd_tconn *tconn, struct packet_info *pi)
{
struct p_protocol *p = pi->data;
int p_proto, p_after_sb_0p, p_after_sb_1p, p_after_sb_2p;
int p_want_lose, p_two_primaries, cf;
int p_discard_my_data, p_two_primaries, cf;
struct net_conf *nc;
p_proto = be32_to_cpu(p->protocol);
......@@ -3018,7 +3018,7 @@ static int receive_protocol(struct drbd_tconn *tconn, struct packet_info *pi)
p_after_sb_2p = be32_to_cpu(p->after_sb_2p);
p_two_primaries = be32_to_cpu(p->two_primaries);
cf = be32_to_cpu(p->conn_flags);
p_want_lose = cf & CF_WANT_LOSE;
p_discard_my_data = cf & CF_DISCARD_MY_DATA;
if (tconn->agreed_pro_version >= 87) {
char integrity_alg[SHARED_SECRET_MAX];
......@@ -3075,8 +3075,8 @@ static int receive_protocol(struct drbd_tconn *tconn, struct packet_info *pi)
goto disconnect_rcu_unlock;
}
if (p_want_lose && nc->want_lose) {
conn_err(tconn, "both sides have the 'want_lose' flag set\n");
if (p_discard_my_data && nc->discard_my_data) {
conn_err(tconn, "both sides have the 'discard_my_data' flag set\n");
goto disconnect_rcu_unlock;
}
......@@ -3806,7 +3806,7 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi)
}
mutex_lock(&mdev->tconn->conf_update);
mdev->tconn->net_conf->want_lose = 0; /* without copy; single bit op is atomic */
mdev->tconn->net_conf->discard_my_data = 0; /* without copy; single bit op is atomic */
mutex_unlock(&mdev->tconn->conf_update);
drbd_md_sync(mdev); /* update connected indicator, la_size, ... */
......
......@@ -161,7 +161,7 @@ GENL_struct(DRBD_NLA_NET_CONF, 5, net_conf,
__u32_field_def(24, GENLA_F_MANDATORY, cong_fill, DRBD_CONG_FILL_DEF)
__u32_field_def(25, GENLA_F_MANDATORY, cong_extents, DRBD_CONG_EXTENTS_DEF)
__flg_field_def(26, GENLA_F_MANDATORY, two_primaries, DRBD_ALLOW_TWO_PRIMARIES_DEF)
__flg_field(27, GENLA_F_MANDATORY | GENLA_F_INVARIANT, want_lose)
__flg_field(27, GENLA_F_MANDATORY | GENLA_F_INVARIANT, discard_my_data)
__flg_field_def(28, GENLA_F_MANDATORY, tcp_cork, DRBD_TCP_CORK_DEF)
__flg_field_def(29, GENLA_F_MANDATORY, always_asbp, DRBD_ALWAYS_ASBP_DEF)
__flg_field(30, GENLA_F_MANDATORY | GENLA_F_INVARIANT, dry_run)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册