diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-05-03 07:14:15 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:55:41 -0500 |
commit | a0095508cac5c413c7119076b26f536486314ef1 (patch) | |
tree | 8300fc680887021c6c2e16b4236f899161759056 | |
parent | 934e6138b56203231d757d7b5ca3252edffc210e (diff) |
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>
-rw-r--r-- | drivers/block/drbd/drbd_int.h | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_main.c | 2 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 16 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 10 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_state.c | 4 |
5 files changed, 17 insertions, 17 deletions
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h index 8655fcb82028..0311dfde776b 100644 --- a/drivers/block/drbd/drbd_int.h +++ b/drivers/block/drbd/drbd_int.h | |||
@@ -832,7 +832,7 @@ struct drbd_tconn { /* is a resource from the config file */ | |||
832 | 832 | ||
833 | unsigned long flags; | 833 | unsigned long flags; |
834 | struct net_conf *net_conf; /* content protected by rcu */ | 834 | struct net_conf *net_conf; /* content protected by rcu */ |
835 | struct mutex net_conf_update; /* mutex for ready-copy-update of net_conf */ | 835 | struct mutex conf_update; /* mutex for ready-copy-update of net_conf and disk_conf */ |
836 | wait_queue_head_t ping_wait; /* Woken upon reception of a ping, and a state change */ | 836 | wait_queue_head_t ping_wait; /* Woken upon reception of a ping, and a state change */ |
837 | struct res_opts res_opts; | 837 | struct res_opts res_opts; |
838 | 838 | ||
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c index 4ae3e7a99d7c..e37244485d72 100644 --- a/drivers/block/drbd/drbd_main.c +++ b/drivers/block/drbd/drbd_main.c | |||
@@ -2474,7 +2474,7 @@ struct drbd_tconn *conn_create(const char *name) | |||
2474 | tconn->cstate = C_STANDALONE; | 2474 | tconn->cstate = C_STANDALONE; |
2475 | mutex_init(&tconn->cstate_mutex); | 2475 | mutex_init(&tconn->cstate_mutex); |
2476 | spin_lock_init(&tconn->req_lock); | 2476 | spin_lock_init(&tconn->req_lock); |
2477 | mutex_init(&tconn->net_conf_update); | 2477 | mutex_init(&tconn->conf_update); |
2478 | init_waitqueue_head(&tconn->ping_wait); | 2478 | init_waitqueue_head(&tconn->ping_wait); |
2479 | idr_init(&tconn->volumes); | 2479 | idr_init(&tconn->volumes); |
2480 | 2480 | ||
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index 8d2c3397cea8..3bad1412be69 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -597,11 +597,11 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | |||
597 | put_ldev(mdev); | 597 | put_ldev(mdev); |
598 | } | 598 | } |
599 | } else { | 599 | } else { |
600 | mutex_lock(&mdev->tconn->net_conf_update); | 600 | mutex_lock(&mdev->tconn->conf_update); |
601 | nc = mdev->tconn->net_conf; | 601 | nc = mdev->tconn->net_conf; |
602 | if (nc) | 602 | if (nc) |
603 | nc->want_lose = 0; /* without copy; single bit op is atomic */ | 603 | nc->want_lose = 0; /* without copy; single bit op is atomic */ |
604 | mutex_unlock(&mdev->tconn->net_conf_update); | 604 | mutex_unlock(&mdev->tconn->conf_update); |
605 | 605 | ||
606 | set_disk_ro(mdev->vdisk, false); | 606 | set_disk_ro(mdev->vdisk, false); |
607 | if (get_ldev(mdev)) { | 607 | if (get_ldev(mdev)) { |
@@ -1829,7 +1829,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) | |||
1829 | conn_reconfig_start(tconn); | 1829 | conn_reconfig_start(tconn); |
1830 | 1830 | ||
1831 | mutex_lock(&tconn->data.mutex); | 1831 | mutex_lock(&tconn->data.mutex); |
1832 | mutex_lock(&tconn->net_conf_update); | 1832 | mutex_lock(&tconn->conf_update); |
1833 | old_conf = tconn->net_conf; | 1833 | old_conf = tconn->net_conf; |
1834 | 1834 | ||
1835 | if (!old_conf) { | 1835 | if (!old_conf) { |
@@ -1903,7 +1903,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) | |||
1903 | crypto_free_hash(tconn->cram_hmac_tfm); | 1903 | crypto_free_hash(tconn->cram_hmac_tfm); |
1904 | tconn->cram_hmac_tfm = crypto.cram_hmac_tfm; | 1904 | tconn->cram_hmac_tfm = crypto.cram_hmac_tfm; |
1905 | 1905 | ||
1906 | mutex_unlock(&tconn->net_conf_update); | 1906 | mutex_unlock(&tconn->conf_update); |
1907 | mutex_unlock(&tconn->data.mutex); | 1907 | mutex_unlock(&tconn->data.mutex); |
1908 | synchronize_rcu(); | 1908 | synchronize_rcu(); |
1909 | kfree(old_conf); | 1909 | kfree(old_conf); |
@@ -1914,7 +1914,7 @@ int drbd_adm_net_opts(struct sk_buff *skb, struct genl_info *info) | |||
1914 | goto done; | 1914 | goto done; |
1915 | 1915 | ||
1916 | fail: | 1916 | fail: |
1917 | mutex_unlock(&tconn->net_conf_update); | 1917 | mutex_unlock(&tconn->conf_update); |
1918 | mutex_unlock(&tconn->data.mutex); | 1918 | mutex_unlock(&tconn->data.mutex); |
1919 | free_crypto(&crypto); | 1919 | free_crypto(&crypto); |
1920 | kfree(new_conf); | 1920 | kfree(new_conf); |
@@ -2010,11 +2010,11 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info) | |||
2010 | 2010 | ||
2011 | conn_flush_workqueue(tconn); | 2011 | conn_flush_workqueue(tconn); |
2012 | 2012 | ||
2013 | mutex_lock(&tconn->net_conf_update); | 2013 | mutex_lock(&tconn->conf_update); |
2014 | old_conf = tconn->net_conf; | 2014 | old_conf = tconn->net_conf; |
2015 | if (old_conf) { | 2015 | if (old_conf) { |
2016 | retcode = ERR_NET_CONFIGURED; | 2016 | retcode = ERR_NET_CONFIGURED; |
2017 | mutex_unlock(&tconn->net_conf_update); | 2017 | mutex_unlock(&tconn->conf_update); |
2018 | goto fail; | 2018 | goto fail; |
2019 | } | 2019 | } |
2020 | rcu_assign_pointer(tconn->net_conf, new_conf); | 2020 | rcu_assign_pointer(tconn->net_conf, new_conf); |
@@ -2027,7 +2027,7 @@ int drbd_adm_connect(struct sk_buff *skb, struct genl_info *info) | |||
2027 | tconn->csums_tfm = crypto.csums_tfm; | 2027 | tconn->csums_tfm = crypto.csums_tfm; |
2028 | tconn->verify_tfm = crypto.verify_tfm; | 2028 | tconn->verify_tfm = crypto.verify_tfm; |
2029 | 2029 | ||
2030 | mutex_unlock(&tconn->net_conf_update); | 2030 | mutex_unlock(&tconn->conf_update); |
2031 | 2031 | ||
2032 | rcu_read_lock(); | 2032 | rcu_read_lock(); |
2033 | idr_for_each_entry(&tconn->volumes, mdev, i) { | 2033 | idr_for_each_entry(&tconn->volumes, mdev, i) { |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 956cdda93430..567d64b9906c 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -3221,7 +3221,7 @@ static int receive_SyncParam(struct drbd_tconn *tconn, struct packet_info *pi) | |||
3221 | p->csums_alg[SHARED_SECRET_MAX-1] = 0; | 3221 | p->csums_alg[SHARED_SECRET_MAX-1] = 0; |
3222 | } | 3222 | } |
3223 | 3223 | ||
3224 | mutex_lock(&mdev->tconn->net_conf_update); | 3224 | mutex_lock(&mdev->tconn->conf_update); |
3225 | old_conf = mdev->tconn->net_conf; | 3225 | old_conf = mdev->tconn->net_conf; |
3226 | 3226 | ||
3227 | if (strcmp(old_conf->verify_alg, p->verify_alg)) { | 3227 | 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) | |||
3296 | } | 3296 | } |
3297 | rcu_assign_pointer(tconn->net_conf, new_conf); | 3297 | rcu_assign_pointer(tconn->net_conf, new_conf); |
3298 | } | 3298 | } |
3299 | mutex_unlock(&mdev->tconn->net_conf_update); | 3299 | mutex_unlock(&mdev->tconn->conf_update); |
3300 | if (new_conf) { | 3300 | if (new_conf) { |
3301 | synchronize_rcu(); | 3301 | synchronize_rcu(); |
3302 | kfree(old_conf); | 3302 | kfree(old_conf); |
@@ -3314,7 +3314,7 @@ static int receive_SyncParam(struct drbd_tconn *tconn, struct packet_info *pi) | |||
3314 | return 0; | 3314 | return 0; |
3315 | 3315 | ||
3316 | disconnect: | 3316 | disconnect: |
3317 | mutex_unlock(&mdev->tconn->net_conf_update); | 3317 | mutex_unlock(&mdev->tconn->conf_update); |
3318 | /* just for completeness: actually not needed, | 3318 | /* just for completeness: actually not needed, |
3319 | * as this is not reached if csums_tfm was ok. */ | 3319 | * as this is not reached if csums_tfm was ok. */ |
3320 | crypto_free_hash(csums_tfm); | 3320 | crypto_free_hash(csums_tfm); |
@@ -3744,9 +3744,9 @@ static int receive_state(struct drbd_tconn *tconn, struct packet_info *pi) | |||
3744 | } | 3744 | } |
3745 | } | 3745 | } |
3746 | 3746 | ||
3747 | mutex_lock(&mdev->tconn->net_conf_update); | 3747 | mutex_lock(&mdev->tconn->conf_update); |
3748 | mdev->tconn->net_conf->want_lose = 0; /* without copy; single bit op is atomic */ | 3748 | mdev->tconn->net_conf->want_lose = 0; /* without copy; single bit op is atomic */ |
3749 | mutex_unlock(&mdev->tconn->net_conf_update); | 3749 | mutex_unlock(&mdev->tconn->conf_update); |
3750 | 3750 | ||
3751 | drbd_md_sync(mdev); /* update connected indicator, la_size, ... */ | 3751 | drbd_md_sync(mdev); /* update connected indicator, la_size, ... */ |
3752 | 3752 | ||
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c index 523ec0940673..332781cfb556 100644 --- a/drivers/block/drbd/drbd_state.c +++ b/drivers/block/drbd/drbd_state.c | |||
@@ -1410,11 +1410,11 @@ static int w_after_conn_state_ch(struct drbd_work *w, int unused) | |||
1410 | if (oc == C_DISCONNECTING && ns_max.conn == C_STANDALONE) { | 1410 | if (oc == C_DISCONNECTING && ns_max.conn == C_STANDALONE) { |
1411 | struct net_conf *old_conf; | 1411 | struct net_conf *old_conf; |
1412 | 1412 | ||
1413 | mutex_lock(&tconn->net_conf_update); | 1413 | mutex_lock(&tconn->conf_update); |
1414 | old_conf = tconn->net_conf; | 1414 | old_conf = tconn->net_conf; |
1415 | rcu_assign_pointer(tconn->net_conf, NULL); | 1415 | rcu_assign_pointer(tconn->net_conf, NULL); |
1416 | conn_free_crypto(tconn); | 1416 | conn_free_crypto(tconn); |
1417 | mutex_unlock(&tconn->net_conf_update); | 1417 | mutex_unlock(&tconn->conf_update); |
1418 | 1418 | ||
1419 | synchronize_rcu(); | 1419 | synchronize_rcu(); |
1420 | kfree(old_conf); | 1420 | kfree(old_conf); |