lkml.org 
[lkml]   [2004]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] 1/1: Device-Mapper: Remove 1024 devices limitation
Kevin Corry <kevcorry@us.ibm.com> wrote:
>
> > Yes, idr is the one to use. That linear search you have in there becomes
> > logarithmic. Will speed up the registration of 100,000 minors no end ;)
>
> I've got a patch that switches from a bit-set to an IDR structure. The only
> thing I'm slightly uncertain about is the case where we're trying to create
> a device with a specific minor number (when creating a DM device, you have
> the choice to specify a minor number or have DM find the first available
> one). To do this, I call idr_find() with the desired minor. If that returns
> NULL (meaning it's not already in use), then I call idr_get_new_above() with
> that same desired minor. In the cases I've tested, this always chooses the
> desired minor, but can we depend on that behavior?

Yes, that has to work - you're holding the lock throughout.

It would be sensible to make that a part of the idr API though.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 14:04    [W:0.519 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site