diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-05-03 08:58:00 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2012-11-08 10:55:42 -0500 |
commit | 2ec91e0e29a3f1166ad96dbb3466b57dbc5d8ebf (patch) | |
tree | 7993fe49f89657e75bf91e64cb61315b8bef678a | |
parent | dc97b70801667ea8b1432b37f5c122405c8d6f96 (diff) |
drbd: Renamed (old|new)_conf into (old|new)_net_conf in receive_SyncParam
Preparing RCU for disk_conf
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_receiver.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 23614e40254a..bba0050f836b 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -3146,7 +3146,7 @@ static int receive_SyncParam(struct drbd_tconn *tconn, struct packet_info *pi) | |||
3146 | unsigned int header_size, data_size, exp_max_sz; | 3146 | unsigned int header_size, data_size, exp_max_sz; |
3147 | struct crypto_hash *verify_tfm = NULL; | 3147 | struct crypto_hash *verify_tfm = NULL; |
3148 | struct crypto_hash *csums_tfm = NULL; | 3148 | struct crypto_hash *csums_tfm = NULL; |
3149 | struct net_conf *old_conf, *new_conf = NULL; | 3149 | struct net_conf *old_net_conf, *new_net_conf = NULL; |
3150 | const int apv = tconn->agreed_pro_version; | 3150 | const int apv = tconn->agreed_pro_version; |
3151 | int *rs_plan_s = NULL; | 3151 | int *rs_plan_s = NULL; |
3152 | int fifo_size = 0; | 3152 | int fifo_size = 0; |
@@ -3222,12 +3222,12 @@ static int receive_SyncParam(struct drbd_tconn *tconn, struct packet_info *pi) | |||
3222 | } | 3222 | } |
3223 | 3223 | ||
3224 | mutex_lock(&mdev->tconn->conf_update); | 3224 | mutex_lock(&mdev->tconn->conf_update); |
3225 | old_conf = mdev->tconn->net_conf; | 3225 | old_net_conf = mdev->tconn->net_conf; |
3226 | 3226 | ||
3227 | if (strcmp(old_conf->verify_alg, p->verify_alg)) { | 3227 | if (strcmp(old_net_conf->verify_alg, p->verify_alg)) { |
3228 | if (mdev->state.conn == C_WF_REPORT_PARAMS) { | 3228 | if (mdev->state.conn == C_WF_REPORT_PARAMS) { |
3229 | dev_err(DEV, "Different verify-alg settings. me=\"%s\" peer=\"%s\"\n", | 3229 | dev_err(DEV, "Different verify-alg settings. me=\"%s\" peer=\"%s\"\n", |
3230 | old_conf->verify_alg, p->verify_alg); | 3230 | old_net_conf->verify_alg, p->verify_alg); |
3231 | goto disconnect; | 3231 | goto disconnect; |
3232 | } | 3232 | } |
3233 | verify_tfm = drbd_crypto_alloc_digest_safe(mdev, | 3233 | verify_tfm = drbd_crypto_alloc_digest_safe(mdev, |
@@ -3238,10 +3238,10 @@ static int receive_SyncParam(struct drbd_tconn *tconn, struct packet_info *pi) | |||
3238 | } | 3238 | } |
3239 | } | 3239 | } |
3240 | 3240 | ||
3241 | if (apv >= 89 && strcmp(old_conf->csums_alg, p->csums_alg)) { | 3241 | if (apv >= 89 && strcmp(old_net_conf->csums_alg, p->csums_alg)) { |
3242 | if (mdev->state.conn == C_WF_REPORT_PARAMS) { | 3242 | if (mdev->state.conn == C_WF_REPORT_PARAMS) { |
3243 | dev_err(DEV, "Different csums-alg settings. me=\"%s\" peer=\"%s\"\n", | 3243 | dev_err(DEV, "Different csums-alg settings. me=\"%s\" peer=\"%s\"\n", |
3244 | old_conf->csums_alg, p->csums_alg); | 3244 | old_net_conf->csums_alg, p->csums_alg); |
3245 | goto disconnect; | 3245 | goto disconnect; |
3246 | } | 3246 | } |
3247 | csums_tfm = drbd_crypto_alloc_digest_safe(mdev, | 3247 | csums_tfm = drbd_crypto_alloc_digest_safe(mdev, |
@@ -3272,34 +3272,34 @@ static int receive_SyncParam(struct drbd_tconn *tconn, struct packet_info *pi) | |||
3272 | } | 3272 | } |
3273 | 3273 | ||
3274 | if (verify_tfm || csums_tfm) { | 3274 | if (verify_tfm || csums_tfm) { |
3275 | new_conf = kzalloc(sizeof(struct net_conf), GFP_KERNEL); | 3275 | new_net_conf = kzalloc(sizeof(struct net_conf), GFP_KERNEL); |
3276 | if (!new_conf) { | 3276 | if (!new_net_conf) { |
3277 | dev_err(DEV, "Allocation of new net_conf failed\n"); | 3277 | dev_err(DEV, "Allocation of new net_conf failed\n"); |
3278 | goto disconnect; | 3278 | goto disconnect; |
3279 | } | 3279 | } |
3280 | 3280 | ||
3281 | *new_conf = *old_conf; | 3281 | *new_net_conf = *old_net_conf; |
3282 | 3282 | ||
3283 | if (verify_tfm) { | 3283 | if (verify_tfm) { |
3284 | strcpy(new_conf->verify_alg, p->verify_alg); | 3284 | strcpy(new_net_conf->verify_alg, p->verify_alg); |
3285 | new_conf->verify_alg_len = strlen(p->verify_alg) + 1; | 3285 | new_net_conf->verify_alg_len = strlen(p->verify_alg) + 1; |
3286 | crypto_free_hash(mdev->tconn->verify_tfm); | 3286 | crypto_free_hash(mdev->tconn->verify_tfm); |
3287 | mdev->tconn->verify_tfm = verify_tfm; | 3287 | mdev->tconn->verify_tfm = verify_tfm; |
3288 | dev_info(DEV, "using verify-alg: \"%s\"\n", p->verify_alg); | 3288 | dev_info(DEV, "using verify-alg: \"%s\"\n", p->verify_alg); |
3289 | } | 3289 | } |
3290 | if (csums_tfm) { | 3290 | if (csums_tfm) { |
3291 | strcpy(new_conf->csums_alg, p->csums_alg); | 3291 | strcpy(new_net_conf->csums_alg, p->csums_alg); |
3292 | new_conf->csums_alg_len = strlen(p->csums_alg) + 1; | 3292 | new_net_conf->csums_alg_len = strlen(p->csums_alg) + 1; |
3293 | crypto_free_hash(mdev->tconn->csums_tfm); | 3293 | crypto_free_hash(mdev->tconn->csums_tfm); |
3294 | mdev->tconn->csums_tfm = csums_tfm; | 3294 | mdev->tconn->csums_tfm = csums_tfm; |
3295 | dev_info(DEV, "using csums-alg: \"%s\"\n", p->csums_alg); | 3295 | dev_info(DEV, "using csums-alg: \"%s\"\n", p->csums_alg); |
3296 | } | 3296 | } |
3297 | rcu_assign_pointer(tconn->net_conf, new_conf); | 3297 | rcu_assign_pointer(tconn->net_conf, new_net_conf); |
3298 | } | 3298 | } |
3299 | mutex_unlock(&mdev->tconn->conf_update); | 3299 | mutex_unlock(&mdev->tconn->conf_update); |
3300 | if (new_conf) { | 3300 | if (new_net_conf) { |
3301 | synchronize_rcu(); | 3301 | synchronize_rcu(); |
3302 | kfree(old_conf); | 3302 | kfree(old_net_conf); |
3303 | } | 3303 | } |
3304 | 3304 | ||
3305 | spin_lock(&mdev->peer_seq_lock); | 3305 | spin_lock(&mdev->peer_seq_lock); |