drbd: rename variable ndc to new_disk_conf

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
This commit is contained in:
Lars Ellenberg 2011-04-27 21:14:57 +02:00 committed by Philipp Reisner
parent 5979e36155
commit 5ecc72c3b9

View File

@ -1159,7 +1159,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
{ {
enum drbd_ret_code retcode; enum drbd_ret_code retcode;
struct drbd_conf *mdev; struct drbd_conf *mdev;
struct disk_conf *ndc; /* new disk conf */ struct disk_conf *new_disk_conf;
int err, fifo_size; int err, fifo_size;
int *rs_plan_s = NULL; int *rs_plan_s = NULL;
@ -1184,39 +1184,39 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
* some half-updated struct when we * some half-updated struct when we
* assign it later. */ * assign it later. */
ndc = kmalloc(sizeof(*ndc), GFP_KERNEL); new_disk_conf = kmalloc(sizeof(*new_disk_conf), GFP_KERNEL);
if (!ndc) { if (!new_disk_conf) {
retcode = ERR_NOMEM; retcode = ERR_NOMEM;
goto fail; goto fail;
} }
memcpy(ndc, &mdev->ldev->dc, sizeof(*ndc)); memcpy(new_disk_conf, &mdev->ldev->dc, sizeof(*new_disk_conf));
if (should_set_defaults(info)) if (should_set_defaults(info))
drbd_set_disk_conf_defaults(ndc); drbd_set_disk_conf_defaults(new_disk_conf);
err = disk_conf_from_attrs_for_change(ndc, info); err = disk_conf_from_attrs_for_change(new_disk_conf, info);
if (err) { if (err) {
retcode = ERR_MANDATORY_TAG; retcode = ERR_MANDATORY_TAG;
drbd_msg_put_info(from_attrs_err_to_txt(err)); drbd_msg_put_info(from_attrs_err_to_txt(err));
} }
if (!expect(ndc->resync_rate >= 1)) if (!expect(new_disk_conf->resync_rate >= 1))
ndc->resync_rate = 1; new_disk_conf->resync_rate = 1;
/* clip to allowed range */ /* clip to allowed range */
if (!expect(ndc->al_extents >= DRBD_AL_EXTENTS_MIN)) if (!expect(new_disk_conf->al_extents >= DRBD_AL_EXTENTS_MIN))
ndc->al_extents = DRBD_AL_EXTENTS_MIN; new_disk_conf->al_extents = DRBD_AL_EXTENTS_MIN;
if (!expect(ndc->al_extents <= DRBD_AL_EXTENTS_MAX)) if (!expect(new_disk_conf->al_extents <= DRBD_AL_EXTENTS_MAX))
ndc->al_extents = DRBD_AL_EXTENTS_MAX; new_disk_conf->al_extents = DRBD_AL_EXTENTS_MAX;
/* most sanity checks done, try to assign the new sync-after /* most sanity checks done, try to assign the new sync-after
* dependency. need to hold the global lock in there, * dependency. need to hold the global lock in there,
* to avoid a race in the dependency loop check. */ * to avoid a race in the dependency loop check. */
retcode = drbd_alter_sa(mdev, ndc->resync_after); retcode = drbd_alter_sa(mdev, new_disk_conf->resync_after);
if (retcode != NO_ERROR) if (retcode != NO_ERROR)
goto fail; goto fail;
fifo_size = (ndc->c_plan_ahead * 10 * SLEEP_TIME) / HZ; fifo_size = (new_disk_conf->c_plan_ahead * 10 * SLEEP_TIME) / HZ;
if (fifo_size != mdev->rs_plan_s.size && fifo_size > 0) { if (fifo_size != mdev->rs_plan_s.size && fifo_size > 0) {
rs_plan_s = kzalloc(sizeof(int) * fifo_size, GFP_KERNEL); rs_plan_s = kzalloc(sizeof(int) * fifo_size, GFP_KERNEL);
if (!rs_plan_s) { if (!rs_plan_s) {
@ -1236,7 +1236,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
wait_event(mdev->al_wait, lc_try_lock(mdev->act_log)); wait_event(mdev->al_wait, lc_try_lock(mdev->act_log));
drbd_al_shrink(mdev); drbd_al_shrink(mdev);
err = drbd_check_al_size(mdev, ndc); err = drbd_check_al_size(mdev, new_disk_conf);
lc_unlock(mdev->act_log); lc_unlock(mdev->act_log);
wake_up(&mdev->al_wait); wake_up(&mdev->al_wait);
@ -1249,7 +1249,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
* To avoid someone looking at a half-updated struct, we probably * To avoid someone looking at a half-updated struct, we probably
* should have a rw-semaphor on net_conf and disk_conf. * should have a rw-semaphor on net_conf and disk_conf.
*/ */
mdev->ldev->dc = *ndc; mdev->ldev->dc = *new_disk_conf;
drbd_md_sync(mdev); drbd_md_sync(mdev);
@ -1259,7 +1259,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
fail: fail:
put_ldev(mdev); put_ldev(mdev);
kfree(ndc); kfree(new_disk_conf);
kfree(rs_plan_s); kfree(rs_plan_s);
out: out:
drbd_adm_finish(info, retcode); drbd_adm_finish(info, retcode);