radix-tree,shmem: introduce radix_tree_iter_next()
authorMatthew Wilcox <willy@linux.intel.com>
Thu, 17 Mar 2016 21:22:06 +0000 (14:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 17 Mar 2016 22:09:34 +0000 (15:09 -0700)
commit7165092fe5ca70bae722ac6cd78421cfd0eec18d
tree93714621a6b7e4c7ba20677a5c7f408795132e8c
parent2cf938aae17203426a89b5955bd1c9668657bfa8
radix-tree,shmem: introduce radix_tree_iter_next()

shmem likes to occasionally drop the lock, schedule, then reacqire the
lock and continue with the iteration from the last place it left off.
This is currently done with a pretty ugly goto.  Introduce
radix_tree_iter_next() and use it throughout shmem.c.

[koct9i@gmail.com: fix bug in radix_tree_iter_next() for tagged iteration]
Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Cc: Hugh Dickins <hughd@google.com>
Signed-off-by: Konstantin Khlebnikov <koct9i@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/linux/radix-tree.h
mm/shmem.c