Re: [PATCH 2/4] page_cache_readahead: remove duplicated code

From: Oleg Nesterov
Date: Wed Jan 26 2005 - 06:01:31 EST


Ram wrote:
>
> No. There is a reason why we had some duplication. With your patch,
> we will end up reading-on-demand instead of reading ahead.
>
> When we notice a sequential reads have resumed, we first read in the
> data that is requested.
> However if the read request is for more pages than what are being held
> in the current window, we make the ahead window as the current window
> and read in more pages in the ahead window. Doing that gives the
> opportunity of always having pages in the ahead window when the next
> sequential read request comes in.

Yes, sorry. I have not noticed that this 'goto out' is conditional in
the 'no ahead window' case.

Thank you for explanation.

However, I still think it makes sense to factor out the common code in
these two cases, just for readability.

I'll redo these patches.

Oleg.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/