Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292680
b: refs/heads/master
c: 9f7de82
h: refs/heads/master
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Mar 22, 2012
1 parent 179dbba commit 7178df8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0e79dedde951e981612ed4e6d74873d61d2a113b
refs/heads/master: 9f7de8275b46d9d11b1505adbfe6c2bb48df4741
8 changes: 5 additions & 3 deletions trunk/lib/idr.c
Original file line number Diff line number Diff line change
Expand Up @@ -595,8 +595,10 @@ EXPORT_SYMBOL(idr_for_each);
* Returns pointer to registered object with id, which is next number to
* given id. After being looked up, *@nextidp will be updated for the next
* iteration.
*
* This function can be called under rcu_read_lock(), given that the leaf
* pointers lifetimes are correctly managed.
*/

void *idr_get_next(struct idr *idp, int *nextidp)
{
struct idr_layer *p, *pa[MAX_LEVEL];
Expand All @@ -605,11 +607,11 @@ void *idr_get_next(struct idr *idp, int *nextidp)
int n, max;

/* find first ent */
n = idp->layers * IDR_BITS;
max = 1 << n;
p = rcu_dereference_raw(idp->top);
if (!p)
return NULL;
n = (p->layer + 1) * IDR_BITS;
max = 1 << n;

while (id < max) {
while (n > 0 && p) {
Expand Down

0 comments on commit 7178df8

Please sign in to comment.