mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Philipp Reisner <philipp.reisner@linbit.com>
To: linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>
Cc: drbd-dev@lists.linbit.com
Subject: [PATCH 03/16] drbd: rename variable ndc to new_disk_conf
Date: Wed,  5 Oct 2011 11:37:51 +0200	[thread overview]
Message-ID: <1317807484-24628-4-git-send-email-philipp.reisner@linbit.com> (raw)
In-Reply-To: <1317807484-24628-1-git-send-email-philipp.reisner@linbit.com>

From: Lars Ellenberg <lars.ellenberg@linbit.com>

Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
---
 drivers/block/drbd/drbd_nl.c |   34 +++++++++++++++++-----------------
 1 files changed, 17 insertions(+), 17 deletions(-)

diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 7bfcb96..51dc869 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1181,7 +1181,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
 {
 	enum drbd_ret_code retcode;
 	struct drbd_conf *mdev;
-	struct disk_conf *ndc; /* new disk conf */
+	struct disk_conf *new_disk_conf;
 	int err, fifo_size;
 	int *rs_plan_s = NULL;
 
@@ -1220,39 +1220,39 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
  * some half-updated struct when we
  * assign it later. */
 
-	ndc = kmalloc(sizeof(*ndc), GFP_KERNEL);
-	if (!ndc) {
+	new_disk_conf = kmalloc(sizeof(*new_disk_conf), GFP_KERNEL);
+	if (!new_disk_conf) {
 		retcode = ERR_NOMEM;
 		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))
-		drbd_set_disk_conf_defaults(ndc);
+		drbd_set_disk_conf_defaults(new_disk_conf);
 
-	err = disk_conf_from_attrs(ndc, info);
+	err = disk_conf_from_attrs(new_disk_conf, info);
 	if (err) {
 		retcode = ERR_MANDATORY_TAG;
 		drbd_msg_put_info(from_attrs_err_to_txt(err));
 	}
 
-	if (!expect(ndc->resync_rate >= 1))
-		ndc->resync_rate = 1;
+	if (!expect(new_disk_conf->resync_rate >= 1))
+		new_disk_conf->resync_rate = 1;
 
 	/* clip to allowed range */
-	if (!expect(ndc->al_extents >= DRBD_AL_EXTENTS_MIN))
-		ndc->al_extents = DRBD_AL_EXTENTS_MIN;
-	if (!expect(ndc->al_extents <= DRBD_AL_EXTENTS_MAX))
-		ndc->al_extents = DRBD_AL_EXTENTS_MAX;
+	if (!expect(new_disk_conf->al_extents >= DRBD_AL_EXTENTS_MIN))
+		new_disk_conf->al_extents = DRBD_AL_EXTENTS_MIN;
+	if (!expect(new_disk_conf->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
 	 * dependency.  need to hold the global lock in there,
 	 * 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)
 		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) {
 		rs_plan_s   = kzalloc(sizeof(int) * fifo_size, GFP_KERNEL);
 		if (!rs_plan_s) {
@@ -1272,7 +1272,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));
 	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);
 	wake_up(&mdev->al_wait);
 
@@ -1285,7 +1285,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
 	 * 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);
 
@@ -1295,7 +1295,7 @@ int drbd_adm_disk_opts(struct sk_buff *skb, struct genl_info *info)
 
  fail:
 	put_ldev(mdev);
-	kfree(ndc);
+	kfree(new_disk_conf);
 	kfree(rs_plan_s);
  out:
 	drbd_adm_finish(info, retcode);
-- 
1.7.4.1


  parent reply	other threads:[~2011-10-05  9:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-05  9:37 [RFC 00/16] drbd: part 14 of adding multiple volume support to drbd Philipp Reisner
2011-10-05  9:37 ` [PATCH 01/16] drbd: Consider all crypto options in connect and in net-options Philipp Reisner
2011-10-05  9:37 ` [PATCH 02/16] drbd: on reconfiguration requests, mind the SET_DEFAULTS flag Philipp Reisner
2011-10-05  9:37 ` Philipp Reisner [this message]
2011-10-05  9:37 ` [PATCH 04/16] drbd: rename variable sc to res_opts Philipp Reisner
2011-10-05  9:37 ` [PATCH 05/16] drbd: fix copy/paste error in comment Philipp Reisner
2011-10-05  9:37 ` [PATCH 06/16] drbd: Wrong use of RCU in receive_protocol() Philipp Reisner
2011-10-05  9:37 ` [PATCH 07/16] drbd: Rename integrity_w_tfm -> integrity_tfm Philipp Reisner
2011-10-05  9:37 ` [PATCH 08/16] drbd: Rename integrity_r_tfm -> peer_integrity_tfm Philipp Reisner
2011-10-05  9:37 ` [PATCH 09/16] drbd: Remove obsolete drbd_crypto_is_hash() Philipp Reisner
2011-10-05  9:37 ` [PATCH 10/16] drbd: Introduce a "lockless" variant of drbd_send_protocoll() Philipp Reisner
2011-10-05  9:37 ` [PATCH 11/16] drbd: Allow to change data-integrity-alg on the fly Philipp Reisner
2011-10-05  9:38 ` [PATCH 12/16] drbd: fix race when forcefully disconnecting Philipp Reisner
2011-10-05  9:38 ` [PATCH 13/16] drbd: fix thread stop deadlock Philipp Reisner
2011-10-05  9:38 ` [PATCH 14/16] drbd: fix schedule in atomic Philipp Reisner
2011-10-05  9:38 ` [PATCH 15/16] drbd: Remove left-over unused define Philipp Reisner
2011-10-05  9:38 ` [PATCH 16/16] drbd: Generate the drbd_set_*_defaults() functions from drbd_genl.h Philipp Reisner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1317807484-24628-4-git-send-email-philipp.reisner@linbit.com \
    --to=philipp.reisner@linbit.com \
    --cc=axboe@kernel.dk \
    --cc=drbd-dev@lists.linbit.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®