X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=mm%2Freadahead.c;h=e4ed04149785f069b201cd2ffaa9caa90c4b0d22;hb=24ba40588fe50adce2a99e026fc0026872ebeb85;hp=829a77c628348a78b9efc130689d549368a57567;hpb=72c1c2f1be6b6574c434bd60991269786c2431a2;p=~andy%2Flinux diff --git a/mm/readahead.c b/mm/readahead.c index 829a77c6283..e4ed0414978 100644 --- a/mm/readahead.c +++ b/mm/readahead.c @@ -371,10 +371,10 @@ static int try_context_readahead(struct address_space *mapping, size = count_history_pages(mapping, ra, offset, max); /* - * no history pages: + * not enough history pages: * it could be a random read */ - if (!size) + if (size <= req_size) return 0; /* @@ -385,8 +385,8 @@ static int try_context_readahead(struct address_space *mapping, size *= 2; ra->start = offset; - ra->size = get_init_ra_size(size + req_size, max); - ra->async_size = ra->size; + ra->size = min(size + req_size, max); + ra->async_size = 1; return 1; }