From patchwork Thu Nov 28 04:58:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Matthew Wilcox (Oracle)" X-Patchwork-Id: 13887699 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 lists.sourceforge.net (lists.sourceforge.net [216.105.38.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 387C3D5E39F for ; Thu, 28 Nov 2024 05:19:43 +0000 (UTC) Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1tGWwI-0002q6-SN; Thu, 28 Nov 2024 05:19:42 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1tGWwH-0002q0-RL for linux-f2fs-devel@lists.sourceforge.net; Thu, 28 Nov 2024 05:19:41 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; 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:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=iDnz3H/XmyzGleAhs0J7K4Tz2nIwaOQHxstlZ5KpVs0=; b=jGwoPAxo/mmzYd6P0v3reu+as8 5aHFznRqLarv/QZTdggEk6zVunfweSysYS9QbFcNknoWCRFmKtt5Pxw+tOTfZV2aQVO8qSBKnXrKE AxHMuRSCuWm2WztaYmOkCFAp06IJZg4LYJid9e69CD2778/0W5TnBHk0K3MY91GoTIAU=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; 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:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=iDnz3H/XmyzGleAhs0J7K4Tz2nIwaOQHxstlZ5KpVs0=; b=JCz+infD1tfkgUpIBhPQC/HmUD vaRWYo5DU49cyQON2H52uPIDjZ54mv8TrVFGZ7Jqml6E5FfJbCnWa5zXwhJKUYrffT4JLpzDHRbJh 2rR2dl40TCaaQZuA8y/8Ucp6KFFsxxCWV8DxJ1ITeOJtzAd7var40U+nT47/tKgtcNsI=; Received: from casper.infradead.org ([90.155.50.34]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1tGWwH-0004fP-6R for linux-f2fs-devel@lists.sourceforge.net; Thu, 28 Nov 2024 05:19:41 +0000 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=iDnz3H/XmyzGleAhs0J7K4Tz2nIwaOQHxstlZ5KpVs0=; b=hPj1tYcj87LpkJe2LXuggfT9MS KtFzBOyxbxVvU/sCx84CA3Bqrc1JaOARZDHPrqZK7Xdo92tpgrmdFBn0jubw35R8TWscJeU9h8PBr /6YsVajgDQCPW4IYDCck9udTr+BcedCMt08Kp4eVnkqtg/WlcPFq7brUKa6pwGkji3/f4QX9vzaYm XQXVo0OBp62X0tw90nMY+zXAerwbHoMAsdeAYNxnShfC5x0Gvx3+9rxbyOlgyut1Qt1kyyKKfEqBG jmrbIqQtNEaHU/DqjLQNw5U5/BRbrc+xX8xANqgb1k64F0+FhsnSgLkvnfxgpV6jekFTa8JUvv0ja wgBd90og==; Received: from willy by casper.infradead.org with local (Exim 4.98 #2 (Red Hat Linux)) id 1tGWbr-00000002DG5-0aRk; Thu, 28 Nov 2024 04:58:35 +0000 From: "Matthew Wilcox (Oracle)" To: Jaegeuk Kim , Chao Yu Date: Thu, 28 Nov 2024 04:58:23 +0000 Message-ID: <20241128045828.527559-9-willy@infradead.org> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241128045828.527559-1-willy@infradead.org> References: <20241128045828.527559-1-willy@infradead.org> MIME-Version: 1.0 X-Headers-End: 1tGWwH-0004fP-6R Subject: [f2fs-dev] [PATCH 08/11] f2fs: Use a folio more in f2fs_submit_page_bio() X-BeenThere: linux-f2fs-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Matthew Wilcox \(Oracle\)" , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Cache the result of page_folio(fio->page) in a local variable so we don't have to keep calling it. Saves a couple of calls to compound_head() and removes an access to page->mapping. Signed-off-by: Matthew Wilcox (Oracle) --- fs/f2fs/data.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index aa08ab387e58..cae5fa895b97 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -684,6 +684,7 @@ void f2fs_flush_merged_writes(struct f2fs_sb_info *sbi) int f2fs_submit_page_bio(struct f2fs_io_info *fio) { struct bio *bio; + struct folio *fio_folio = page_folio(fio->page); struct page *page = fio->encrypted_page ? fio->encrypted_page : fio->page; @@ -697,8 +698,8 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio) /* Allocate a new bio */ bio = __bio_alloc(fio, 1); - f2fs_set_bio_crypt_ctx(bio, fio->page->mapping->host, - page_folio(fio->page)->index, fio, GFP_NOIO); + f2fs_set_bio_crypt_ctx(bio, fio_folio->mapping->host, + fio_folio->index, fio, GFP_NOIO); if (bio_add_page(bio, page, PAGE_SIZE, 0) < PAGE_SIZE) { bio_put(bio); @@ -706,8 +707,7 @@ int f2fs_submit_page_bio(struct f2fs_io_info *fio) } if (fio->io_wbc && !is_read_io(fio->op)) - wbc_account_cgroup_owner(fio->io_wbc, page_folio(fio->page), - PAGE_SIZE); + wbc_account_cgroup_owner(fio->io_wbc, fio_folio, PAGE_SIZE); inc_page_count(fio->sbi, is_read_io(fio->op) ? __read_io_type(page) : WB_DATA_TYPE(fio->page, false));