linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@rustcorp.com.au>
To: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Philipp Reisner <philipp.reisner@linbit.com>,
	Lars Ellenberg <lars.ellenberg@linbit.com>,
	linux-next@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: linux-next: drbd tree build failure
Date: Wed, 29 Jul 2009 11:10:55 +0930	[thread overview]
Message-ID: <200907291110.56241.rusty@rustcorp.com.au> (raw)
In-Reply-To: <20090728142040.9b2df926.sfr@canb.auug.org.au>

On Tue, 28 Jul 2009 01:50:40 pm Stephen Rothwell wrote:
> Hi Philipp, Lars,
> 
> On Mon, 27 Jul 2009 19:17:55 +0200 Philipp Reisner <philipp.reisner@linbit.com> wrote:
> >
> > Ok. Lars' patch is now complete and arrived in the git tree...
> > 
> > It should build now with Rusty's paches.
> 
> Thanks.
> 

This is untested, but fairly trivial transform to avoid cpumask_t in the struct
as well:

Subject: drdb: use cpumask_var_t in struct drdb_conf

Any code which can be compiled on x86 should try to avoid cpumask_t
(or even struct cpumask) declarations; we are heading towards struct
cpumask being undefined if CONFIG_CPUMASK_OFFSTACK.

The code is the same for CONFIG_CPUMASK_OFFSTACK=n.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index 5813d7d..10fa153 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1006,7 +1006,7 @@ struct drbd_conf {
 	spinlock_t peer_seq_lock;
 	unsigned int minor;
 	unsigned long comm_bm_set; /* communicated number of set bits. */
-	cpumask_t cpu_mask;
+	cpumask_var_t cpu_mask;
 	struct bm_io_work bm_io_work;
 	u64 ed_uuid; /* UUID of the exposed data */
 	struct mutex state_mutex;
diff --git a/drivers/block/drbd/drbd_main.c b/drivers/block/drbd/drbd_main.c
index 20f4d40..9c85a4b 100644
--- a/drivers/block/drbd/drbd_main.c
+++ b/drivers/block/drbd/drbd_main.c
@@ -1550,18 +1550,18 @@ void drbd_calc_cpu_mask(struct drbd_conf *mdev)
 	int ord, cpu;
 
 	/* user override. */
-	if (cpumask_weight(&mdev->cpu_mask))
+	if (cpumask_weight(mdev->cpu_mask))
 		return;
 
 	ord = mdev_to_minor(mdev) % cpumask_weight(cpu_online_mask);
 	for_each_online_cpu(cpu) {
 		if (ord-- == 0) {
-			cpumask_set_cpu(cpu, &mdev->cpu_mask);
+			cpumask_set_cpu(cpu, mdev->cpu_mask);
 			return;
 		}
 	}
 	/* should not be reached */
-	cpumask_setall(&mdev->cpu_mask);
+	cpumask_setall(mdev->cpu_mask);
 }
 
 /**
@@ -1584,7 +1584,7 @@ void drbd_thread_current_set_cpu(struct drbd_conf *mdev)
 	if (!thi->reset_cpu_mask)
 		return;
 	thi->reset_cpu_mask = 0;
-	set_cpus_allowed_ptr(p, &mdev->cpu_mask);
+	set_cpus_allowed_ptr(p, mdev->cpu_mask);
 }
 #endif
 
@@ -3001,6 +3001,8 @@ struct drbd_conf *drbd_new_device(unsigned int minor)
 	mdev = kzalloc(sizeof(struct drbd_conf), GFP_KERNEL);
 	if (!mdev)
 		return NULL;
+	if (!zalloc_cpumask_var(&mdev->cpu_mask, GFP_KERNEL))
+		goto out_no_cpumask;
 
 	mdev->minor = minor;
 
@@ -3079,6 +3081,8 @@ out_no_io_page:
 out_no_disk:
 	blk_cleanup_queue(q);
 out_no_q:
+	free_cpumask_var(mdev->cpu_mask);
+out_no_cpumask:
 	kfree(mdev);
 	return NULL;
 }
@@ -3095,6 +3099,7 @@ void drbd_free_mdev(struct drbd_conf *mdev)
 	__free_page(mdev->md_io_page);
 	put_disk(mdev->vdisk);
 	blk_cleanup_queue(mdev->rq_queue);
+	free_cpumask_var(mdev->cpu_mask);
 	kfree(mdev);
 }
 
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 936ec73..ede19be 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -1657,8 +1657,8 @@ static int drbd_nl_syncer_conf(struct drbd_conf *mdev, struct drbd_nl_cfg_req *n
 	if (mdev->state.conn >= C_CONNECTED)
 		drbd_send_sync_param(mdev, &sc);
 
-	if (!cpumask_equal(&mdev->cpu_mask, new_cpu_mask)) {
-		cpumask_copy(&mdev->cpu_mask, new_cpu_mask);
+	if (!cpumask_equal(mdev->cpu_mask, new_cpu_mask)) {
+		cpumask_copy(mdev->cpu_mask, new_cpu_mask);
 		drbd_calc_cpu_mask(mdev);
 		mdev->receiver.reset_cpu_mask = 1;
 		mdev->asender.reset_cpu_mask = 1;

  reply	other threads:[~2009-07-29  1:40 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-27  5:48 linux-next: drbd tree build failure Stephen Rothwell
2009-07-27  8:09 ` Lars Ellenberg
2009-07-27 17:17   ` Philipp Reisner
2009-07-28  4:20     ` Stephen Rothwell
2009-07-29  1:40       ` Rusty Russell [this message]
2009-07-29 15:11         ` Philipp Reisner
2009-07-27  7:37 Stephen Rothwell
2009-07-27  9:09 ` Philipp Reisner
2009-07-27 11:38   ` Alexander Beregalov
2009-07-27 15:07     ` Philipp Reisner
2009-07-28  4:19       ` Stephen Rothwell
2009-07-28  4:20   ` Stephen Rothwell
2009-07-29  5:29 Stephen Rothwell
2009-07-29  6:20 ` Jens Axboe
2009-07-29 15:13   ` Philipp Reisner
2009-07-29  5:29 Stephen Rothwell
2009-07-29  5:47 ` Martin K. Petersen
2009-07-29  6:17   ` Stephen Rothwell
2009-08-18  5:32   ` Stephen Rothwell
2009-08-18  6:01     ` Martin K. Petersen
2009-09-15  6:07 Stephen Rothwell
2009-09-15  6:23 ` Jens Axboe
2009-09-15  6:53   ` Stephen Rothwell
     [not found]     ` <20090915165309.f07381ec.sfr-3FnU+UHB4dNDw9hX6IcOSA@public.gmane.org>
2009-09-15  6:57       ` Jens Axboe
2009-09-15  7:45         ` Stephen Rothwell
2009-09-15 14:03       ` 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=200907291110.56241.rusty@rustcorp.com.au \
    --to=rusty@rustcorp.com.au \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.kernel.org \
    --cc=philipp.reisner@linbit.com \
    --cc=sfr@canb.auug.org.au \
    /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;
as well as URLs for NNTP newsgroup(s).