git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6
[pandora-kernel.git]
/
lib
/
idr.c
diff --git
a/lib/idr.c
b/lib/idr.c
index
2eb1dca
..
c1a2069
100644
(file)
--- a/
lib/idr.c
+++ b/
lib/idr.c
@@
-445,6
+445,7
@@
EXPORT_SYMBOL(idr_remove);
void idr_remove_all(struct idr *idp)
{
int n, id, max;
void idr_remove_all(struct idr *idp)
{
int n, id, max;
+ int bt_mask;
struct idr_layer *p;
struct idr_layer *pa[MAX_LEVEL];
struct idr_layer **paa = &pa[0];
struct idr_layer *p;
struct idr_layer *pa[MAX_LEVEL];
struct idr_layer **paa = &pa[0];
@@
-462,8
+463,10
@@
void idr_remove_all(struct idr *idp)
p = p->ary[(id >> n) & IDR_MASK];
}
p = p->ary[(id >> n) & IDR_MASK];
}
+ bt_mask = id;
id += 1 << n;
id += 1 << n;
- while (n < fls(id)) {
+ /* Get the highest bit that the above add changed from 0->1. */
+ while (n < fls(id ^ bt_mask)) {
if (p)
free_layer(p);
n += IDR_BITS;
if (p)
free_layer(p);
n += IDR_BITS;
@@
-623,7
+626,7
@@
void *idr_get_next(struct idr *idp, int *nextidp)
}
return NULL;
}
}
return NULL;
}
-
+EXPORT_SYMBOL(idr_get_next);
/**
/**