struct file *filp, unsigned long offset)
{
unsigned max;
- unsigned min;
unsigned orig_next_size;
unsigned actual;
int first_access=0;
if (max == 0)
goto out; /* No readahead */
- min = get_min_readahead(ra);
orig_next_size = ra->next_size;
if (ra->next_size == 0) {
* pages shall be accessed in the next
* current window.
*/
- ra->next_size = min(ra->average , (unsigned long)max);
+ 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->start = offset;
ra->size = ra->next_size;
ra->size = max;
ra->ahead_start = 0;
ra->ahead_size = 0;
+ ra->average = max / 2;
}
}
ra->prev_page = offset;