Skip to content

Commit

Permalink
readahead: remove one unnecessary radix tree lookup
Browse files Browse the repository at this point in the history
(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>
  • Loading branch information
Wu Fengguang authored and Linus Torvalds committed Jun 17, 2009
1 parent fc31d16 commit caca7cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mm/readahead.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,7 @@ ondemand_readahead(struct address_space *mapping,
pgoff_t start;

rcu_read_lock();
start = radix_tree_next_hole(&mapping->page_tree, offset,max+1);
start = radix_tree_next_hole(&mapping->page_tree, offset+1,max);
rcu_read_unlock();

if (!start || start - offset > max)
Expand Down

0 comments on commit caca7cb

Please sign in to comment.