You've already forked linux-apfs
mirror of
https://github.com/linux-apfs/linux-apfs.git
synced 2026-05-01 15:00:59 -07:00
drbd: Renamed the net_conf_update mutex to conf_update
Preparing to use the same mutex for disk_conf updates Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
@@ -832,7 +832,7 @@ struct drbd_tconn { /* is a resource from the config file */
|
|||||||
|
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
struct net_conf *net_conf; /* content protected by rcu */
|
struct net_conf *net_conf; /* content protected by rcu */
|
||||||
struct mutex net_conf_update; /* mutex for ready-copy-update of net_conf */
|
struct mutex conf_update; /* mutex for ready-copy-update of net_conf and disk_conf */
|
||||||
wait_queue_head_t ping_wait; /* Woken upon reception of a ping, and a state change */
|
wait_queue_head_t ping_wait; /* Woken upon reception of a ping, and a state change */
|
||||||
struct res_opts res_opts;
|
struct res_opts res_opts;
|
||||||
|
|
||||||
|
|||||||
@@ -2474,7 +2474,7 @@ struct drbd_tconn *conn_create(const char *name)
|
|||||||
tconn->cstate = C_STANDALONE;
|
tconn->cstate = C_STANDALONE;
|
||||||
mutex_init(&tconn->cstate_mutex);
|
mutex_init(&tconn->cstate_mutex);
|
||||||
spin_lock_init(&tconn->req_lock);
|
spin_lock_init(&tconn->req_lock);
|
||||||
mutex_init(&tconn->net_conf_update);
|
mutex_init(&tconn->conf_update);
|
||||||
init_waitqueue_head(&tconn->ping_wait);
|
init_waitqueue_head(&tconn->ping_wait);
|
||||||
idr_init(&tconn->volumes);
|
idr_init(&tconn->volumes);
|
||||||
|
|
||||||
|
|||||||
@@ -597,11 +597,11 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force)
|
|||||||
put_ldev(mdev);
|
put_ldev(mdev);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
mutex_lock(&mdev->tconn->net_conf_update);
|
mutex_lock(&mdev->tconn->conf_update);
|
||||||
nc = mdev->tconn->net_conf;
|
nc = mdev->tconn->net_conf;
|
||||||
if (nc)
|
if (nc)
|
||||||
nc->want_lose = 0; /* without copy; single bit op is atomic */
|
nc->want_lose = 0; /* without copy; single bit op is atomic */
|
||||||
mutex_unlock(&mdev->tconn->net_conf_update);
|
mutex_unlock(&mdev->tconn->conf_update);
|
||||||
|
|
||||||
set_disk_ro(mdev->vdisk, false);
|
set_disk_ro(mdev->vdisk, false);
|
||||||
if (get_ldev(mdev)) {
|
if (get_ldev(mdev)) {
|
||||||
@@ -1829,7 +1829,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info)
|
|||||||
conn_reconfig_start(tconn);
|
conn_reconfig_start(tconn);
|
||||||
|
|
||||||
mutex_lock(&tconn->data.mutex);
|
mutex_lock(&tconn->data.mutex);
|
||||||
mutex_lock(&tconn->net_conf_update);
|
mutex_lock(&tconn->conf_update);
|
||||||
old_conf = tconn->net_conf;
|
old_conf = tconn->net_conf;
|
||||||
|
|
||||||
if (!old_conf) {
|
if (!old_conf) {
|
||||||
@@ -1903,7 +1903,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info)
|
|||||||
crypto_free_hash(tconn->cram_hmac_tfm);
|
crypto_free_hash(tconn->cram_hmac_tfm);
|
||||||
tconn->cram_hmac_tfm = crypto.cram_hmac_tfm;
|
tconn->cram_hmac_tfm = crypto.cram_hmac_tfm;
|
||||||
|
|
||||||
mutex_unlock(&tconn->net_conf_update);
|
mutex_unlock(&tconn->conf_update);
|
||||||
mutex_unlock(&tconn->data.mutex);
|
mutex_unlock(&tconn->data.mutex);
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
kfree(old_conf);
|
kfree(old_conf);
|
||||||
@@ -1914,7 +1914,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info)
|
|||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
mutex_unlock(&tconn->net_conf_update);
|
mutex_unlock(&tconn->conf_update);
|
||||||
mutex_unlock(&tconn->data.mutex);
|
mutex_unlock(&tconn->data.mutex);
|
||||||
free_crypto(&crypto);
|
free_crypto(&crypto);
|
||||||
kfree(new_conf);
|
kfree(new_conf);
|
||||||
@@ -2010,11 +2010,11 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info)
|
|||||||
|
|
||||||
conn_flush_workqueue(tconn);
|
conn_flush_workqueue(tconn);
|
||||||
|
|
||||||
mutex_lock(&tconn->net_conf_update);
|
mutex_lock(&tconn->conf_update);
|
||||||
old_conf = tconn->net_conf;
|
old_conf = tconn->net_conf;
|
||||||
if (old_conf) {
|
if (old_conf) {
|
||||||
retcode = ERR_NET_CONFIGURED;
|
retcode = ERR_NET_CONFIGURED;
|
||||||
mutex_unlock(&tconn->net_conf_update);
|
mutex_unlock(&tconn->conf_update);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
rcu_assign_pointer(tconn->net_conf, new_conf);
|
rcu_assign_pointer(tconn->net_conf, new_conf);
|
||||||
@@ -2027,7 +2027,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info)
|
|||||||
tconn->csums_tfm = crypto.csums_tfm;
|
tconn->csums_tfm = crypto.csums_tfm;
|
||||||
tconn->verify_tfm = crypto.verify_tfm;
|
tconn->verify_tfm = crypto.verify_tfm;
|
||||||
|
|
||||||
mutex_unlock(&tconn->net_conf_update);
|
mutex_unlock(&tconn->conf_update);
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
idr_for_each_entry(&tconn->volumes, mdev, i) {
|
idr_for_each_entry(&tconn->volumes, mdev, i) {
|
||||||
|
|||||||
@@ -3221,7 +3221,7 @@ static int receive_SyncParam(struct drbd_tconn *tconn, struct packet_info *pi)
|
|||||||
p->csums_alg[SHARED_SECRET_MAX-1] = 0;
|
p->csums_alg[SHARED_SECRET_MAX-1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&mdev->tconn->net_conf_update);
|
mutex_lock(&mdev->tconn->conf_update);
|
||||||
old_conf = mdev->tconn->net_conf;
|
old_conf = mdev->tconn->net_conf;
|
||||||
|
|
||||||
if (strcmp(old_conf->verify_alg, p->verify_alg)) {
|
if (strcmp(old_conf->verify_alg, p->verify_alg)) {
|
||||||
@@ -3296,7 +3296,7 @@ static int receive_SyncParam(struct drbd_tconn *tconn, struct packet_info *pi)
|
|||||||
}
|
}
|
||||||
rcu_assign_pointer(tconn->net_conf, new_conf);
|
rcu_assign_pointer(tconn->net_conf, new_conf);
|
||||||
}
|
}
|
||||||
mutex_unlock(&mdev->tconn->net_conf_update);
|
mutex_unlock(&mdev->tconn->conf_update);
|
||||||
if (new_conf) {
|
if (new_conf) {
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
kfree(old_conf);
|
kfree(old_conf);
|
||||||
@@ -3314,7 +3314,7 @@ static int receive_SyncParam(struct drbd_tconn *tconn, struct packet_info *pi)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
disconnect:
|
disconnect:
|
||||||
mutex_unlock(&mdev->tconn->net_conf_update);
|
mutex_unlock(&mdev->tconn->conf_update);
|
||||||
/* just for completeness: actually not needed,
|
/* just for completeness: actually not needed,
|
||||||
* as this is not reached if csums_tfm was ok. */
|
* as this is not reached if csums_tfm was ok. */
|
||||||
crypto_free_hash(csums_tfm);
|
crypto_free_hash(csums_tfm);
|
||||||
@@ -3744,9 +3744,9 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mutex_lock(&mdev->tconn->net_conf_update);
|
mutex_lock(&mdev->tconn->conf_update);
|
||||||
mdev->tconn->net_conf->want_lose = 0; /* without copy; single bit op is atomic */
|
mdev->tconn->net_conf->want_lose = 0; /* without copy; single bit op is atomic */
|
||||||
mutex_unlock(&mdev->tconn->net_conf_update);
|
mutex_unlock(&mdev->tconn->conf_update);
|
||||||
|
|
||||||
drbd_md_sync(mdev); /* update connected indicator, la_size, ... */
|
drbd_md_sync(mdev); /* update connected indicator, la_size, ... */
|
||||||
|
|
||||||
|
|||||||
@@ -1410,11 +1410,11 @@ static int w_after_conn_state_ch(struct drbd_work *w, int unused)
|
|||||||
if (oc == C_DISCONNECTING && ns_max.conn == C_STANDALONE) {
|
if (oc == C_DISCONNECTING && ns_max.conn == C_STANDALONE) {
|
||||||
struct net_conf *old_conf;
|
struct net_conf *old_conf;
|
||||||
|
|
||||||
mutex_lock(&tconn->net_conf_update);
|
mutex_lock(&tconn->conf_update);
|
||||||
old_conf = tconn->net_conf;
|
old_conf = tconn->net_conf;
|
||||||
rcu_assign_pointer(tconn->net_conf, NULL);
|
rcu_assign_pointer(tconn->net_conf, NULL);
|
||||||
conn_free_crypto(tconn);
|
conn_free_crypto(tconn);
|
||||||
mutex_unlock(&tconn->net_conf_update);
|
mutex_unlock(&tconn->conf_update);
|
||||||
|
|
||||||
synchronize_rcu();
|
synchronize_rcu();
|
||||||
kfree(old_conf);
|
kfree(old_conf);
|
||||||
|
|||||||
Reference in New Issue
Block a user