Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 310483
b: refs/heads/master
c: fffaee3
h: refs/heads/master
i:
  310481: cc215f2
  310479: 170fd6a
v: v3
  • Loading branch information
Konstantin Khlebnikov authored and Linus Torvalds committed Jun 5, 2012
1 parent bd4eccf commit 1d44702
Show file tree
Hide file tree
Showing 3 changed files with 8 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: f9ba7179ce91fb77b2adf6eaab3676ab3a1f5a15
refs/heads/master: fffaee365fded09f9ebf2db19066065fa54323c3
5 changes: 4 additions & 1 deletion trunk/include/linux/radix-tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,8 +368,11 @@ radix_tree_next_slot(void **slot, struct radix_tree_iter *iter, unsigned flags)
iter->index++;
if (likely(*slot))
return slot;
if (flags & RADIX_TREE_ITER_CONTIG)
if (flags & RADIX_TREE_ITER_CONTIG) {
/* forbid switching to the next chunk */
iter->next_index = 0;
break;
}
}
}
return NULL;
Expand Down
3 changes: 3 additions & 0 deletions trunk/lib/radix-tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,9 @@ void **radix_tree_next_chunk(struct radix_tree_root *root,
* during iterating; it can be zero only at the beginning.
* And we cannot overflow iter->next_index in a single step,
* because RADIX_TREE_MAP_SHIFT < BITS_PER_LONG.
*
* This condition also used by radix_tree_next_slot() to stop
* contiguous iterating, and forbid swithing to the next chunk.
*/
index = iter->next_index;
if (!index && iter->index)
Expand Down

0 comments on commit 1d44702

Please sign in to comment.