Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180728
b: refs/heads/master
c: d2e7276
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 23, 2010
1 parent 7db80d7 commit 6ba50ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 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: 701188374b6f1ef9cf7e4dce4a2e69ef4c0012ac
refs/heads/master: d2e7276b6b5e4bc2148891a056d5862c5314342d
4 changes: 3 additions & 1 deletion trunk/lib/idr.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,12 @@ static int sub_alloc(struct idr *idp, int *starting_id, struct idr_layer **pa)
id = (id | ((1 << (IDR_BITS * l)) - 1)) + 1;

/* if already at the top layer, we need to grow */
if (!(p = pa[l])) {
if (id >= 1 << (idp->layers * IDR_BITS)) {
*starting_id = id;
return IDR_NEED_TO_GROW;
}
p = pa[l];
BUG_ON(!p);

/* If we need to go up one layer, continue the
* loop; otherwise, restart from the top.
Expand Down

0 comments on commit 6ba50ec

Please sign in to comment.