From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755416AbcI0Dnu (ORCPT ); Mon, 26 Sep 2016 23:43:50 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:47068 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753111AbcI0Dnk (ORCPT ); Mon, 26 Sep 2016 23:43:40 -0400 Date: Tue, 27 Sep 2016 04:43:38 +0100 From: Al Viro To: Miklos Szeredi Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/11] filemap: add get_page_for_read() helper Message-ID: <20160927034338.GH19539@ZenIV.linux.org.uk> References: <1473842236-28655-1-git-send-email-mszeredi@redhat.com> <1473842236-28655-9-git-send-email-mszeredi@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1473842236-28655-9-git-send-email-mszeredi@redhat.com> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.