unsigned long flags;
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 */
struct res_opts res_opts;
tconn->cstate = C_STANDALONE;
mutex_init(&tconn->cstate_mutex);
spin_lock_init(&tconn->req_lock);
- mutex_init(&tconn->net_conf_update);
+ mutex_init(&tconn->conf_update);
init_waitqueue_head(&tconn->ping_wait);
idr_init(&tconn->volumes);
put_ldev(mdev);
}
} else {
- mutex_lock(&mdev->tconn->net_conf_update);
+ mutex_lock(&mdev->tconn->conf_update);
nc = mdev->tconn->net_conf;
if (nc)
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);
if (get_ldev(mdev)) {
conn_reconfig_start(tconn);
mutex_lock(&tconn->data.mutex);
- mutex_lock(&tconn->net_conf_update);
+ mutex_lock(&tconn->conf_update);
old_conf = tconn->net_conf;
if (!old_conf) {
crypto_free_hash(tconn->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);
synchronize_rcu();
kfree(old_conf);
goto done;
fail:
- mutex_unlock(&tconn->net_conf_update);
+ mutex_unlock(&tconn->conf_update);
mutex_unlock(&tconn->data.mutex);
free_crypto(&crypto);
kfree(new_conf);
conn_flush_workqueue(tconn);
- mutex_lock(&tconn->net_conf_update);
+ mutex_lock(&tconn->conf_update);
old_conf = tconn->net_conf;
if (old_conf) {
retcode = ERR_NET_CONFIGURED;
- mutex_unlock(&tconn->net_conf_update);
+ mutex_unlock(&tconn->conf_update);
goto fail;
}
rcu_assign_pointer(tconn->net_conf, new_conf);
tconn->csums_tfm = crypto.csums_tfm;
tconn->verify_tfm = crypto.verify_tfm;
- mutex_unlock(&tconn->net_conf_update);
+ mutex_unlock(&tconn->conf_update);
rcu_read_lock();
idr_for_each_entry(&tconn->volumes, mdev, i) {
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;
if (strcmp(old_conf->verify_alg, p->verify_alg)) {
}
rcu_assign_pointer(tconn->net_conf, new_conf);
}
- mutex_unlock(&mdev->tconn->net_conf_update);
+ mutex_unlock(&mdev->tconn->conf_update);
if (new_conf) {
synchronize_rcu();
kfree(old_conf);
return 0;
disconnect:
- mutex_unlock(&mdev->tconn->net_conf_update);
+ mutex_unlock(&mdev->tconn->conf_update);
/* just for completeness: actually not needed,
* as this is not reached if csums_tfm was ok. */
crypto_free_hash(csums_tfm);
}
}
- 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 */
- mutex_unlock(&mdev->tconn->net_conf_update);
+ mutex_unlock(&mdev->tconn->conf_update);
drbd_md_sync(mdev); /* update connected indicator, la_size, ... */
if (oc == C_DISCONNECTING && ns_max.conn == C_STANDALONE) {
struct net_conf *old_conf;
- mutex_lock(&tconn->net_conf_update);
+ mutex_lock(&tconn->conf_update);
old_conf = tconn->net_conf;
rcu_assign_pointer(tconn->net_conf, NULL);
conn_free_crypto(tconn);
- mutex_unlock(&tconn->net_conf_update);
+ mutex_unlock(&tconn->conf_update);
synchronize_rcu();
kfree(old_conf);