lkml.org 
[lkml]   [2011]   [Jul]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: RFC: Boiler plate functions for ida / idr allocation?
On 07/13/11 14:31, Tejun Heo wrote:
> (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.
Cool.

Rusty, are you pursuing this? Approach looks sensible to me.


\
 
 \ /
  Last update: 2011-07-13 15:51    [W:0.131 / U:0.892 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site