Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2495860rdb; Thu, 21 Sep 2023 23:26:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF7FoM9DAmGFYh0w00sP81IFTjnpLGYksLJdPVkn/f74xb4ESReZ/uFONgXYggSM7vlAA62 X-Received: by 2002:a05:6a00:b90:b0:68c:d6f:212b with SMTP id g16-20020a056a000b9000b0068c0d6f212bmr7943572pfj.19.1695363968346; Thu, 21 Sep 2023 23:26:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695363968; cv=none; d=google.com; s=arc-20160816; b=o7gO5966PzI8MzBoBmcnvzHnse0p8pkPmGNAFJS00TQaQhzT2pbqxIhkQpYa2VjFSv +9k0SwCmFu2Xgh9YDLtOXTCUiE4ckZ0m+gCdRx2EUIz7K3fq2Mdb80pJrFxsRe0YgMBZ KaB5kUf0XLLrP+00SzvUQKkwInGCCjnIDEUupRhTCzA3EiKGttVl+0BpM59m5UYTdnpp KaIhZvfdpeeP8QgZk84LJDr7tqjDEbyp2ROn4E4R5daMZxYVqboPACjY5f+W1RVS/CZc IKExsQnnbvlhpFTiO3gQoNTagZkNqEczpDueF04LS7zJcbxYmNsaE6pe67xVIXSXyt3p PrVQ== 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=OmhYxZWP+Y6kyZIC9zAP6b0+avnvzgP9pmdSogeenOc=; fh=c8NKFRvP9+Ml9XvzqG2nGqhVxTjW39J/I/tkc5xa6gs=; b=xI46oHc/uNz/aqqbtbg1dN8Ha+HvSCEclN7gEVb7fSfaJgbN0iUmsJ4IBKFEA5E7u1 JuPcs8Ko2HcRYeYZS7HnpMpBnJEqIhP1/iePJYISKLsTEUqUNWtioaJjH+TrCjVplyF2 FHx+xQhW6pUcZopoVtqgs72qkfAn1izTUtWacdfvhC/ODe5nhbrp3zQy8/pVF4mebAts APEcqDOQefBcqveaY+D+4ZHkdcicbXfy4T+5GAR2f1YpCfoQtGZIUguHEbLuHNw9yMV4 vE89cjr1scYLYf4tg3YSiv3s+RtYMMY/cD8fH1+D8WV1kaaobXK/UM/fcDhDWgLgVFkL BziA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Ycq5ZDJT; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id s16-20020a056a00195000b0068e4c3f3ac2si3247890pfk.245.2023.09.21.23.26.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 23:26:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Ycq5ZDJT; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 65A1080B1980; Thu, 21 Sep 2023 13:30:45 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231738AbjIUUao (ORCPT + 99 others); Thu, 21 Sep 2023 16:30:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbjIUU3K (ORCPT ); Thu, 21 Sep 2023 16:29:10 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF1D72698; Thu, 21 Sep 2023 13:07:55 -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=OmhYxZWP+Y6kyZIC9zAP6b0+avnvzgP9pmdSogeenOc=; b=Ycq5ZDJTRsyt+3zqybhj/R4da6 dOJvPT0dU3J7JyyP4QsAc5PloybfGsg/eLdduDO3+Jhzu9LLSOKV0yECLF58J8f3wHKEwQXqcw2ty zQPem6fl3DUSjIoVpbd52Mer9BcNebshD+HvbmGW+UCJfrGKqLWE80nc1QTEs85wUmGI3xWjDilAd sCB5jkxA9gwLuZSrPgjaxyDx7qgv1k6LBlaNUTV51Zlp4y4GtQXzQS7LPoA3WzWUPOwC3wngqLlwW sbLH8vS9ozrpUL8faO4PeNotIyf7nKkVh70ajctKV8fAxF6fniBTa1NGMOqibiBKdKAItVE6FeIb3 NTlpRCDw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qjPxk-00DrVq-1E; 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 06/10] ext2: Convert ext2_empty_dir() to use a folio Date: Thu, 21 Sep 2023 21:07:43 +0100 Message-Id: <20230921200746.3303942-6-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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Thu, 21 Sep 2023 13:30:46 -0700 (PDT) Save two calls to compound_head() by using the folio API. Signed-off-by: Matthew Wilcox (Oracle) --- fs/ext2/dir.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fs/ext2/dir.c b/fs/ext2/dir.c index 31333b23adf3..2fc910e99234 100644 --- a/fs/ext2/dir.c +++ b/fs/ext2/dir.c @@ -669,16 +669,16 @@ int ext2_make_empty(struct inode *inode, struct inode *parent) /* * routine to check that the specified directory is empty (for rmdir) */ -int ext2_empty_dir (struct inode * inode) +int ext2_empty_dir(struct inode *inode) { - struct page *page; + struct folio *folio; char *kaddr; unsigned long i, npages = dir_pages(inode); for (i = 0; i < npages; i++) { ext2_dirent *de; - kaddr = ext2_get_page(inode, i, 0, &page); + kaddr = ext2_get_folio(inode, i, 0, &folio); if (IS_ERR(kaddr)) return 0; @@ -707,12 +707,12 @@ int ext2_empty_dir (struct inode * inode) } de = ext2_next_entry(de); } - ext2_put_page(page, kaddr); + folio_release_kmap(folio, kaddr); } return 1; not_empty: - ext2_put_page(page, kaddr); + folio_release_kmap(folio, kaddr); return 0; } -- 2.40.1