X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=mm%2Freadahead.c;h=97239562622d41822af8cda3979426e4f155df35;hb=f9296eb00ed30209424102d3c920e69617eea853;hp=7073392b3357784a514fe972a20e170ed85ee954;hpb=a91482bdcc2e0f6035702e46f1b99043a0893346;p=linux-2.6.git diff --git a/mm/readahead.c b/mm/readahead.c index 7073392b3..972395626 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -349,6 +349,7 @@ page_cache_readahead(struct address_space *mapping, struct file_ra_state *ra, struct file *filp, unsigned long offset) { unsigned max; + unsigned min; unsigned orig_next_size; unsigned actual; int first_access=0; @@ -373,6 +374,7 @@ page_cache_readahead(struct address_space *mapping, struct file_ra_state *ra, if (max == 0) goto out; /* No readahead */ + min = get_min_readahead(ra); orig_next_size = ra->next_size; if (ra->next_size == 0) { @@ -468,11 +470,7 @@ do_io: * pages shall be accessed in the next * current window. */ - average = ra->average; - if (ra->serial_cnt > average) - average = (ra->serial_cnt + ra->average + 1) / 2; - - ra->next_size = min(average , (unsigned long)max); + ra->next_size = min(ra->average , (unsigned long)max); } ra->start = offset; ra->size = ra->next_size; @@ -554,7 +552,6 @@ void handle_ra_miss(struct address_space *mapping, ra->size = max; ra->ahead_start = 0; ra->ahead_size = 0; - ra->average = max / 2; } } ra->prev_page = offset;