From 1d44702260f4f7774e80d26ee191840aa2ebda45 Mon Sep 17 00:00:00 2001 From: Konstantin Khlebnikov Date: Tue, 5 Jun 2012 21:36:33 +0400 Subject: [PATCH] --- yaml --- r: 310483 b: refs/heads/master c: fffaee365fded09f9ebf2db19066065fa54323c3 h: refs/heads/master i: 310481: cc215f2c8685cebbde4d2e6948178c99e4e95f15 310479: 170fd6a43e774871d96556b4f4320464981f4fc6 v: v3 --- [refs] | 2 +- trunk/include/linux/radix-tree.h | 5 ++++- trunk/lib/radix-tree.c | 3 +++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/[refs] b/[refs] index f3a3a7e3ee1c..fe6e0628be62 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: f9ba7179ce91fb77b2adf6eaab3676ab3a1f5a15 +refs/heads/master: fffaee365fded09f9ebf2db19066065fa54323c3 diff --git a/trunk/include/linux/radix-tree.h b/trunk/include/linux/radix-tree.h index 0d04cd69ab9b..ffc444c38b0a 100644 --- a/trunk/include/linux/radix-tree.h +++ b/trunk/include/linux/radix-tree.h @@ -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; diff --git a/trunk/lib/radix-tree.c b/trunk/lib/radix-tree.c index d7c878cc006c..e7964296fd50 100644 --- a/trunk/lib/radix-tree.c +++ b/trunk/lib/radix-tree.c @@ -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)