From: Tejun Heo <tj@kernel.org>
To: Jonathan Cameron <jic23@cam.ac.uk>
Cc: LKML <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Rusty Russell <rusty@rustcorp.com.au>
Subject: Re: RFC: Boiler plate functions for ida / idr allocation?
Date: Wed, 13 Jul 2011 15:31:39 +0200 [thread overview]
Message-ID: <20110713133139.GO2872@htj.dyndns.org> (raw)
In-Reply-To: <4E1D6900.6040500@cam.ac.uk>
(cc'ing Rusty Russell)
Hello,
On Wed, Jul 13, 2011 at 10:44:32AM +0100, Jonathan Cameron wrote:
> The other thing this highlights is that I suspect quite a few are protected by
> spin locks when a mutex would be fine. Hence that might be worth tidying up first.
>
> Anyhow, a cleanup worth making? (obviously the exact form needs some work, but
> I think the following is enough to start a discussion!)
>
> Subject: [PATCH] ida utility function
Rusty suggested similar addition some weeks ago, so people are really
getting annoyed by this.
http://thread.gmane.org/gmane.linux.kernel/1148513/focus=74236
Here's an interface that I think should work,
int ida_get(struct ida *ida, int begin, int end, gfp_t gfp);
It uses an internal spinlock, returns the allocated ID and @end <= 0
indicates no limit.
Thanks.
--
tejun
next prev parent reply other threads:[~2011-07-13 13:31 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 9:44 Jonathan Cameron
2011-07-13 12:41 ` Stefan Richter
2011-07-15 18:12 ` Boaz Harrosh
2011-07-15 21:35 ` Stefan Richter
2011-07-13 13:14 ` Stefan Richter
2011-07-13 13:17 ` Jonathan Cameron
2011-07-13 13:31 ` Tejun Heo [this message]
2011-07-13 13:48 ` Jonathan Cameron
2011-07-21 6:50 ` Rusty Russell
2011-07-21 7:37 ` Rusty Russell
2011-07-21 8:19 ` Tejun Heo
2011-07-21 8:29 ` Jonathan Cameron
2011-07-21 8:35 ` Tejun Heo
2011-07-22 11:13 ` Rusty Russell
2011-07-22 16:43 ` Jonathan Cameron
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=20110713133139.GO2872@htj.dyndns.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=jic23@cam.ac.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=rusty@rustcorp.com.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
all inboxes | Powered by JetHome®