Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp40380pxv; Wed, 14 Jul 2021 22:25:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtyMCs7up5hXvYBNuFjqralHmy/jpsnitbm4w+7jGVEeO+SbgvgF31UghtLQBJgFhCxBf5 X-Received: by 2002:a92:260f:: with SMTP id n15mr1386487ile.143.1626326740156; Wed, 14 Jul 2021 22:25:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626326740; cv=none; d=google.com; s=arc-20160816; b=ltOe7tO5gb2yQl5Wg+b+x4enq4KngAEjHBxbSjznch4rVyVXXkQQVGjhhHenzgBZ/t 2z8gvVoG2gJv93+Q3itE0sSbcqb+LjEDcA5VAcafGpsWADvIkb5OLxienbplWM9Fa98T J+xoaG8WoHzTFFcD3GLRWGdsekeJuhcZ1KflNoAf2pa4pnDLJ2u7K48kPwQGaOBR5DXJ gUnHqHVEpcxc2Bn3CM2Zi7hSRW1kgwUHqIAHwTT4rOsue0ACmffd5jWkqBCdo8oRr2JC MMbb6qBk7Fxq/lAaZbX+UbCccETWbADGAB3yTUU+eBUSg/wbizzFGxCO1+x45Eb2hYof 3snA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9RHYJbjPvnqicnRJcqR3syd4A7W3DXyDdvohNQa07JI=; b=JckzydTouJLofOAoNIjAi6a/XVMxXdAHZeZspbm6balYGW5gHtqh1HfC/p8TvhBHCs 3AjgtLTQF8f3TYe0QXetHo+NRfK90DbXumzwLSO+DaBvEtUqCSG5P0wW8wEsTcKDvey2 +2sNKoiyiHVv4+neX2QPhPi4Bc1LThSrKRnLHicm+DkXb0EXGZnGUAnF5GgcDYXxLrOL /ndZLdDBVvmm9bNzhwU1n9stwBvrz0Afadb1hfg0RjR5m8cbreWITNefyJ7cy7uvzgaC rp4fLegn9ckbm8PGiRKGjwFEibXTUDTMt5zLslaU3kmm5S7XmDEO3sSS2p+07yL5JI+Q rCPg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Zj8UrZa7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n20si6126081jat.115.2021.07.14.22.25.27; Wed, 14 Jul 2021 22:25:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Zj8UrZa7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239201AbhGOFPC (ORCPT + 99 others); Thu, 15 Jul 2021 01:15:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233239AbhGOFPC (ORCPT ); Thu, 15 Jul 2021 01:15:02 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 18611C06175F; Wed, 14 Jul 2021 22:12:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=9RHYJbjPvnqicnRJcqR3syd4A7W3DXyDdvohNQa07JI=; b=Zj8UrZa7kSb9ZwkzDckQztJeFe R4tDSJ8RkEAG1IPNgOo8dEsqucfYgosHHX6oGjHL2aHTMwidm6W6Habvk1966Gz3QJXSE+lNfFKDg wq7lMx/m8maoTG3TzNBAbEf1ooCAxFRk6BooKtLto9oqR/ppDlR8JRnPylYlwzV9xZQyHQzLpWoPp i/v87a/rqNdTD/TDp1QsJsXztDv88/I0NnpnKgX8wCNm77Xn0VQx3bsQ30LI6ghO53pNoGzUpmfRk +2RTV7VdZbJ6hx6ggCR4PT6RpXWff9FfYis4+Jr/2jXsePOfjkUtzSrrpx0VtUPFSScpHHZ4iPbtL Wdw2zBzg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m3tdc-0030Dm-Nl; Thu, 15 Jul 2021 05:10:31 +0000 From: "Matthew Wilcox (Oracle)" To: linux-kernel@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org Subject: [PATCH v14 115/138] mm/filemap: Convert filemap_create_page to folio Date: Thu, 15 Jul 2021 04:36:41 +0100 Message-Id: <20210715033704.692967-116-willy@infradead.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210715033704.692967-1-willy@infradead.org> References: <20210715033704.692967-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is all internal to filemap and saves 100 bytes of text. Signed-off-by: Matthew Wilcox (Oracle) --- mm/filemap.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/filemap.c b/mm/filemap.c index 5e2a2db1c715..7eda9afb0600 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -2396,32 +2396,32 @@ static int filemap_update_page(struct kiocb *iocb, return error; } -static int filemap_create_page(struct file *file, +static int filemap_create_folio(struct file *file, struct address_space *mapping, pgoff_t index, struct pagevec *pvec) { - struct page *page; + struct folio *folio; int error; - page = page_cache_alloc(mapping); - if (!page) + folio = filemap_alloc_folio(mapping_gfp_mask(mapping), 0); + if (!folio) return -ENOMEM; - error = add_to_page_cache_lru(page, mapping, index, + error = filemap_add_folio(mapping, folio, index, mapping_gfp_constraint(mapping, GFP_KERNEL)); if (error == -EEXIST) error = AOP_TRUNCATED_PAGE; if (error) goto error; - error = filemap_read_folio(file, mapping, page_folio(page)); + error = filemap_read_folio(file, mapping, folio); if (error) goto error; - pagevec_add(pvec, page); + pagevec_add(pvec, &folio->page); return 0; error: - put_page(page); + folio_put(folio); return error; } @@ -2463,7 +2463,7 @@ static int filemap_get_pages(struct kiocb *iocb, struct iov_iter *iter, if (!pagevec_count(pvec)) { if (iocb->ki_flags & (IOCB_NOWAIT | IOCB_WAITQ)) return -EAGAIN; - err = filemap_create_page(filp, mapping, + err = filemap_create_folio(filp, mapping, iocb->ki_pos >> PAGE_SHIFT, pvec); if (err == AOP_TRUNCATED_PAGE) goto retry; -- 2.30.2