Commit caca7cb748571a5b39943a9b3e7081feef055e5e

Authored by Wu Fengguang
Committed by Linus Torvalds
1 parent fc31d16add

readahead: remove one unnecessary radix tree lookup

(hit_readahead_marker != 0) means the page at @offset is present, so we
can search for non-present page starting from @offset+1.

Reported-by: Xu Chenfeng <xcf@ustc.edu.cn>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Ying Han <yinghan@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 1 deletions Side-by-side Diff

... ... @@ -395,7 +395,7 @@
395 395 pgoff_t start;
396 396  
397 397 rcu_read_lock();
398   - start = radix_tree_next_hole(&mapping->page_tree, offset,max+1);
  398 + start = radix_tree_next_hole(&mapping->page_tree, offset+1,max);
399 399 rcu_read_unlock();
400 400  
401 401 if (!start || start - offset > max)