Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp588999rdh; Sun, 24 Sep 2023 03:32:01 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFBl87bzqR/GBn5UHjobLa54zT/Gr4UaXeC7FbAzvwipBymb61O9nJSoJ2j12M3I4yZavM9 X-Received: by 2002:a05:6870:8a2c:b0:1d5:9ae7:ec79 with SMTP id p44-20020a0568708a2c00b001d59ae7ec79mr5890379oaq.12.1695551521109; Sun, 24 Sep 2023 03:32:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695551521; cv=none; d=google.com; s=arc-20160816; b=xPMg6D/QUoxwArijOfj5pTSTpzw62CskOBEIOTgRuFXAmESoSGlsWGtEHKkywYHAZi IL/N2hI1lOdbdIzLUiSh5dCRawlZSX/BjaeOvGjgy1hgMiCqdb7/VK51oXoogB2Y03as PLpfOt8DQ5iZJVhbW1xEe/4Yf7KRhoS1uqxByLfvIw5awQJML2qlnsEiLDdhaIboG8s3 VAJfI377bEBdNTBf65qC85qW7jld1OmLfTmhXiSE90tQuV6jC5kg5RX3d0ijkP99AbzP aqd6x9W6pCQth+LcrhNlhMLKnIVPHZINkZe8yxVPbkK9VmFMNGVb762i5fXlRu2ftSNK +PGw== 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=DpcGBZFseQaBcbzBaplzUJIEQ4KhgQ0pIV/RSG6D0J4=; fh=c8NKFRvP9+Ml9XvzqG2nGqhVxTjW39J/I/tkc5xa6gs=; b=uzqQHuyuYgMS1b7WsVST9FAs2gcSLxGnhEdnuReKf33F5wEhtL4VwMHO52xP1amN/z nrydSVkgzfU4Iz2/z/YDwvgFKDKpIGI19igbZfrR00zSSxEaU2BKteTQ5P3EhfNCopPj FgoAkGOPJuQB5TSTLMRg2EXBIG6CKYlVz6k2kQBeRaTwWzOph6vf3sr4wLfpfkdomouu ilWCEc8DXOoSmlo/bcvZxqwGXoGBOBprV2Hr97aCkhKncayN6ZsTnBePfMAv3zvUCbHX 3cPLbwFqCrpsLlYSQbK6VdRd9SH0U6p8S6WWC9xYeRHTmHmyDn55BS3eOELqEwtF0QvS t8yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VDPXuH+n; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id i194-20020a636dcb000000b0057c3fe0131dsi5866983pgc.30.2023.09.24.03.32.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Sep 2023 03:32:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=VDPXuH+n; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 3712F832994F; Thu, 21 Sep 2023 13:29:02 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231921AbjIUU2l (ORCPT + 99 others); Thu, 21 Sep 2023 16:28:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231963AbjIUU2V (ORCPT ); Thu, 21 Sep 2023 16:28:21 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B5AF72A5; Thu, 21 Sep 2023 13:07:50 -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=DpcGBZFseQaBcbzBaplzUJIEQ4KhgQ0pIV/RSG6D0J4=; b=VDPXuH+nctu3+Y0e/1+wC+wO5n CR62cr6GO7K1jGLHiIlH+HdNuLDl4yanrRYRpTdJNPgQvwH96duOFQY17d87Di+T3m5geOYEpxecP pTcDjHrrHPjqYYXau+S7F3sNmQPcAMO3O50Yq4y+4z4lQbYDgYAxM+p5tTEsijMH9OYzmMajEulup PrnN9BjLgn0JxXDJ2JUMTGdJmr11UfiuC2pKYP4CbqxjSooU4sTwllcMcs6RzoJ/RZqJp3uv4s0Lo XFYzVmFnMqLk5lnP3/3DXXzgAP1wAkR7qoB6+hNGl3acwl2ZGWVGyVsw5eziWqNtoodV1iCc8l0a9 /y+PREuQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qjPxk-00DrW4-AN; Thu, 21 Sep 2023 20:07:48 +0000 From: "Matthew Wilcox (Oracle)" To: Jan Kara Cc: "Matthew Wilcox (Oracle)" , linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, "Fabio M . De Francesco" Subject: [PATCH 09/10] ext2: Convert ext2_make_empty() to use a folio Date: Thu, 21 Sep 2023 21:07:46 +0100 Message-Id: <20230921200746.3303942-9-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230921200746.3303942-1-willy@infradead.org> References: <20230921200746.3303942-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Thu, 21 Sep 2023 13:29:02 -0700 (PDT) Remove two hidden calls to compound_head() by using the folio API. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext2/dir.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index dad71ef38395..414680bdb170 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -618,21 +618,21 @@ int ext2_delete_entry(struct ext2_dir_entry_2 *dir, struct folio *folio) */ int ext2_make_empty(struct inode *inode, struct inode *parent) { - struct page *page = grab_cache_page(inode->i_mapping, 0); + struct folio *folio = filemap_grab_folio(inode->i_mapping, 0); unsigned chunk_size = ext2_chunk_size(inode); struct ext2_dir_entry_2 * de; int err; void *kaddr; - if (!page) - return -ENOMEM; + if (IS_ERR(folio)) + return PTR_ERR(folio); - err = ext2_prepare_chunk(page, 0, chunk_size); + err = ext2_prepare_chunk(&folio->page, 0, chunk_size); if (err) { - unlock_page(page); + folio_unlock(folio); goto fail; } - kaddr = kmap_local_page(page); + kaddr = kmap_local_folio(folio, 0); memset(kaddr, 0, chunk_size); de = (struct ext2_dir_entry_2 *)kaddr; de->name_len = 1; @@ -648,10 +648,10 @@ int ext2_make_empty(struct inode *inode, struct inode *parent) memcpy (de->name, "..\0", 4); ext2_set_de_type (de, inode); kunmap_local(kaddr); - ext2_commit_chunk(page, 0, chunk_size); + ext2_commit_chunk(&folio->page, 0, chunk_size); err = ext2_handle_dirsync(inode); fail: - put_page(page); + folio_put(folio); return err; } -- 2.40.1