Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 180169
b: refs/heads/master
c: 859ddf0
h: refs/heads/master
i:
  180167: f47ee85
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 3, 2010
1 parent 41093e2 commit 6fd2dd4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 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: 1a45dcfe2525e9432cb4aba461d4994fc2befe42
refs/heads/master: 859ddf09743a8cc680af33f7259ccd0fd36bfe9d
7 changes: 3 additions & 4 deletions trunk/lib/idr.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,7 @@ static int sub_alloc(struct idr *idp, int *starting_id, struct idr_layer **pa)
id = *starting_id;
restart:
p = idp->top;
l = idp->layers;
pa[l--] = NULL;
l = p->layer;
while (1) {
/*
* We run around this while until we reach the leaf node...
Expand All @@ -155,8 +154,8 @@ static int sub_alloc(struct idr *idp, int *starting_id, struct idr_layer **pa)
oid = id;
id = (id | ((1 << (IDR_BITS * l)) - 1)) + 1;

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

0 comments on commit 6fd2dd4

Please sign in to comment.