summaryrefslogtreecommitdiff
path: root/mm/readahead.c
diff options
context:
space:
mode:
authorMatthew Wilcox <willy@infradead.org>2017-11-21 14:07:06 -0500
committerMatthew Wilcox <willy@infradead.org>2018-10-21 10:46:33 -0400
commit0d3f92966629e536b0c5c2355c1ada8e21c245f6 (patch)
tree1fe6674dbc2e0164749a904c29065dec9a707ac1 /mm/readahead.c
parenteb797a8ee0ab4cd03df556980ce7bf167cadaa50 (diff)
page cache: Convert hole search to XArray
The page cache offers the ability to search for a miss in the previous or next N locations. Rather than teach the XArray about the page cache's definition of a miss, use xas_prev() and xas_next() to search the page array. This should be more efficient as it does not have to start the lookup from the top for each index. Signed-off-by: Matthew Wilcox <willy@infradead.org>
Diffstat (limited to 'mm/readahead.c')
-rw-r--r--mm/readahead.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/readahead.c b/mm/readahead.c
index de657077d41d..fc4dd364b37a 100644
--- a/mm/readahead.c
+++ b/mm/readahead.c
@@ -336,7 +336,7 @@ static pgoff_t count_history_pages(struct address_space *mapping,
pgoff_t head;
rcu_read_lock();
- head = page_cache_prev_hole(mapping, offset - 1, max);
+ head = page_cache_prev_miss(mapping, offset - 1, max);
rcu_read_unlock();
return offset - 1 - head;
@@ -425,7 +425,7 @@ ondemand_readahead(struct address_space *mapping,
pgoff_t start;
rcu_read_lock();
- start = page_cache_next_hole(mapping, offset + 1, max_pages);
+ start = page_cache_next_miss(mapping, offset + 1, max_pages);
rcu_read_unlock();
if (!start || start - offset > max_pages)