Re: [PATCH 08/11] filemap: add get_page_for_read() helper
From: Al Viro
Date: Mon Sep 26 2016 - 23:43:51 EST
On Wed, Sep 14, 2016 at 10:37:13AM +0200, Miklos Szeredi wrote:
> Getting the page for reading is pretty complicated. This functionality is
> also duplicated between generic_file_read() generic_file_splice_read().
>
> So first extract the common code from do_generic_file_read() into a
> separate helper function that takes a filp, the page index, the offset into
> the page and the byte count and returns the page ready for reading (or an
> error).
>
> This makes do_generic_file_read() much easier to read as well.
__generic_file_splice_read() horrors are not going to survive - see the
patchset posted on fsdevel. do_generic_file_read() getting easier to
read is certainly a good thing, provided that we don't screw the code
generation for what's a fairly hot path. IOW, that one really needs
profiling.