lkml.org 
[lkml]   [2004]   [Jul]   [7]   [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
Jim Houston <jim.houston@comcast.net> wrote:
>
> On Tue, 2004-07-06 at 19:16, Andrew Morton wrote:
> Jim Houston <jim.houston@comcast.net> wrote:
> > >
> > > With out the test above an id beyond the allocated space will alias
> > > to one that exists. Perhaps the highest id currently allocated is
> > > 100, there will be two layers in the radix tree and the while loop
> > > above will only look at the 10 least significant bits. If you call
> > > idr_find with 1025 it will return the pointer associated with id 1.
> >
> > OK.
> >
> > > The patch I sent was against linux-2.6.7, so I missed the change to
> > > MAX_ID_SHIFT.
> >
> > How about this?
> >
> > n = idp->layers * IDR_BITS;
> > + if (id >= (1 << n))
> > + return NULL;
> > +
> > p = idp->top;
> > +
> > /* Mask off upper bits we don't use for the search. */
> > id &= MAX_ID_MASK;
> >
>
> Hi Andrew,
>
> It's not quite right. If you want to keep a count in the upper bits
> you have to mask off that count before checking if the id is beyond the
> end of the allocated space.

OK, I'll fix that up.

But I don't want to keep a count in the upper bits! I want rid of that
stuff altogether, completely, all of it. It just keeps on hanging around :(

We should remove MAX_ID_* from the kernel altogether.
-
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.043 / U:1.056 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site