From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6481BC433F5 for ; Thu, 23 Dec 2021 15:18:42 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 820336B0075; Thu, 23 Dec 2021 10:18:41 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 7A9156B0078; Thu, 23 Dec 2021 10:18:41 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 696FB6B007B; Thu, 23 Dec 2021 10:18:41 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0232.hostedemail.com [216.40.44.232]) by kanga.kvack.org (Postfix) with ESMTP id 56B146B0075 for ; Thu, 23 Dec 2021 10:18:41 -0500 (EST) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 13B9C181AC9C6 for ; Thu, 23 Dec 2021 15:18:41 +0000 (UTC) X-FDA: 78949416042.28.B86A517 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf05.hostedemail.com (Postfix) with ESMTP id 178C0100028 for ; Thu, 23 Dec 2021 15:18:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=KXbYPtu6c4izulwkGYHyNy4v0pLcq0pJiP6IwBzT1BY=; b=dZsKdYlICJs6w6ZgnrzsjBjap0 0YmUCN5iRmK8z01ycWdIlX1qVGfroYBjD+Gq5x+BTbGAY5+tUuicq/xCncIVjO6DCA63PxWzotinj 69NNUqiiw4ZT/Hp0bcjOsOW1V4vQgtfxaKtINuqWuCt9zWrqfbMhP8OIhDFN+Jt8Z9qEtCrQEvUBO OZH2y/DBe5Rsj8GpHvDU8vpOenTpdfs1M4Vl1pQv2e4yaUZBQmDt94cxD9wfIRAqp9hl7kKFiI+zn xxkh28aDpHGr2QDKuMc3NCYmh5VK2jRnxPL1309SOlTb62BF+3z2iMBKKyVeRBEFyDdIDEpFDdiat wxO7krhg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0PrW-004MpU-DL; Thu, 23 Dec 2021 15:18:34 +0000 Date: Thu, 23 Dec 2021 15:18:34 +0000 From: Matthew Wilcox To: Christoph Hellwig Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 25/48] filemap: Add read_cache_folio and read_mapping_folio Message-ID: References: <20211208042256.1923824-1-willy@infradead.org> <20211208042256.1923824-26-willy@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=dZsKdYlI; dmarc=none; spf=none (imf05.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 178C0100028 X-Stat-Signature: oic8arsf6pdazb67u5ctji9m7zzqwxqk X-HE-Tag: 1640272719-642661 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, Dec 23, 2021 at 08:39:59AM +0100, Christoph Hellwig wrote: > > thn makes up for the extra 100 bytes of text added to the various > > s/thn/ > > > return read_cache_page(mapping, index, NULL, data); > > } > > > > +static inline struct folio *read_mapping_folio(struct address_space *mapping, > > + pgoff_t index, void *data) > > +{ > > + return read_cache_folio(mapping, index, NULL, data); > > +} > > Is there much of a point in this wrapper? Comparing read_mapping_page() vs read_cache_page(), 4 callers vs ~50. It's definitely the preferred form, so I'd rather keep it. > > +static struct page *do_read_cache_page(struct address_space *mapping, > > + pgoff_t index, filler_t *filler, void *data, gfp_t gfp) > > +{ > > + struct folio *folio = read_cache_folio(mapping, index, filler, data); > > + if (IS_ERR(folio)) > > + return &folio->page; > > + return folio_file_page(folio, index); > > +} > > This drops the gfp on the floor. Oops. Will fix.