mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
mm: filemap: move radix tree hole searching here
The radix tree hole searching code is only used for page cache, for example the readahead code trying to get a a picture of the area surrounding a fault. It sufficed to rely on the radix tree definition of holes, which is "empty tree slot". But this is about to change, though, as shadow page descriptors will be stored in the page cache after the actual pages get evicted from memory. Move the functions over to mm/filemap.c and make them native page cache operations, where they can later be adapted to handle the new definition of "page cache hole". Signed-off-by: Johannes Weiner <[email protected]> Reviewed-by: Rik van Riel <[email protected]> Reviewed-by: Minchan Kim <[email protected]> Acked-by: Mel Gorman <[email protected]> Cc: Andrea Arcangeli <[email protected]> Cc: Bob Liu <[email protected]> Cc: Christoph Hellwig <[email protected]> Cc: Dave Chinner <[email protected]> Cc: Greg Thelen <[email protected]> Cc: Hugh Dickins <[email protected]> Cc: Jan Kara <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Cc: Luigi Semenzato <[email protected]> Cc: Metin Doslu <[email protected]> Cc: Michel Lespinasse <[email protected]> Cc: Ozgun Erdogan <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Roman Gushchin <[email protected]> Cc: Ryan Mallon <[email protected]> Cc: Tejun Heo <[email protected]> Cc: Vlastimil Babka <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
6dbaf22ce1
commit
e7b563bb2a
6 changed files with 84 additions and 82 deletions
|
|
@ -347,7 +347,7 @@ static pgoff_t count_history_pages(struct address_space *mapping,
|
|||
pgoff_t head;
|
||||
|
||||
rcu_read_lock();
|
||||
head = radix_tree_prev_hole(&mapping->page_tree, offset - 1, max);
|
||||
head = page_cache_prev_hole(mapping, offset - 1, max);
|
||||
rcu_read_unlock();
|
||||
|
||||
return offset - 1 - head;
|
||||
|
|
@ -427,7 +427,7 @@ ondemand_readahead(struct address_space *mapping,
|
|||
pgoff_t start;
|
||||
|
||||
rcu_read_lock();
|
||||
start = radix_tree_next_hole(&mapping->page_tree, offset+1,max);
|
||||
start = page_cache_next_hole(mapping, offset + 1, max);
|
||||
rcu_read_unlock();
|
||||
|
||||
if (!start || start - offset > max)
|
||||
|
|
|
|||
Loading…
Reference in a new issue