Skip to content

Commit

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

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

0 comments on commit 6cc9afc

Please sign in to comment.