Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1096480rdb; Tue, 19 Sep 2023 22:15:42 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHAZe2VUOvy11nISMZ8C/lH2aBNdnVSL4AHtqhI7JKAgHL2X7j6tBecTFjViqIYezRGDA0u X-Received: by 2002:a05:6358:2496:b0:139:bbae:1f3 with SMTP id m22-20020a056358249600b00139bbae01f3mr2020885rwc.3.1695186941706; Tue, 19 Sep 2023 22:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695186941; cv=none; d=google.com; s=arc-20160816; b=g0JCUf5NDI32amGDwCdGyZvOHlVlLv9P4NsdfFr7DV4KgZdAKaikqxSnuI4kQJuld+ CKlpATD6eKnrtWmV0Jd1w1HXGnp7pn2lckxvQFZY+/BgLjimfsgxnhLVabFf6pchP8iw dm5rXtncRJC+d1sLdbQi6ZwmT3fduazdN4YwIHQigCLHnR8Vv8+FQtB3KDXx390ckKed 1IXuGh25pKNhapuMAn/BrVXDDhrAVnt6RCPnOHv2PMrR14hYCqB84VBbEPYhN6nM6J3e S9DGhqaWWeFMCe7fj7OLDuG3VbtLiGLiUDLJdaC8zlLpwx7z/+6E9GkNXvMEyC3qSAm0 Ly/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=0ngNBnUvO+0NVI0ss84Zb16ZvzrZCajcq442dwEgXZM=; fh=sRR9gJ37ChtesxPb1iPEABChem0KgDKda8d5/HUMrrk=; b=F1LPL0X+4h+Sb8WpeHzqHCjmJhgvl99HrKKsEcVEwmjFIr3a6EY0/rEGWSZxJrLMLG 9PogEZhNc+o+cghvkEfMJ+2jK93Wm3qMoHFJKiiVNaJrisWvSkYmZ0bAiIiAQBcPCI6D fEvEhtBt7vvBGUfP1OhnG3LBfTTbeXhDYw1jiB30vJU4FQ5y11q54+gZ9YtRKj4Tf8aC JubYTvUNZVT+VHL8a2EWKXrZ/lNah/4eirfO6JXUM4JtGobeLLjRNf6ovP80MN9LdbjL J4ioO4kE8Qq1sU4YVYCZx+C0nP+YaxCHMIrmdFuGq3RYLsQw97T3LoXRskrFyY3mAMRv QXZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="g+3/Erv4"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id ob9-20020a17090b390900b00274afd5346esi841105pjb.151.2023.09.19.22.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 22:15:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b="g+3/Erv4"; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id CB808819F9A3; Tue, 19 Sep 2023 20:43:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232281AbjITDnR (ORCPT + 99 others); Tue, 19 Sep 2023 23:43:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232496AbjITDnP (ORCPT ); Tue, 19 Sep 2023 23:43:15 -0400 Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B5FFE4; Tue, 19 Sep 2023 20:43:09 -0700 (PDT) Received: by mail-ua1-x934.google.com with SMTP id a1e0cc1a2514c-7a8aec82539so1737684241.2; Tue, 19 Sep 2023 20:43:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695181388; x=1695786188; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=0ngNBnUvO+0NVI0ss84Zb16ZvzrZCajcq442dwEgXZM=; b=g+3/Erv4hFKcuCv2O7BRAjQ/Sf5qNufTwuCHO9aZUPwz5wkniiYT5IFjWhmXgPAN8q 684QC4tmy7nWrWUXjQzDY5ejXdA1KuGrHAMlUDa8J+xGEdI2KwwZ5TZBSuoa39M3vfbi RHzcyFl6765pSpCIPY0p09rQfEWtYwh/DI1JbABtM4cY0v5vNH7ToFbUJHw2Fn2Gyey3 eb1/iFoFEpEkgoXxv1br7LhWwzxMbZKx9nMCtTHPROqYOpYOjXk3xMHHq9h6BqWzA97y M4RKms9pEfdtoNhCrIncJrMslBrnDDDS9aSOiKCAkr56NcLKzts2W7HJRHZ9VZo+sETk 1OsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695181388; x=1695786188; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=0ngNBnUvO+0NVI0ss84Zb16ZvzrZCajcq442dwEgXZM=; b=OGpk8goygr/066dtsb3sYG63ZQX/M17hLdsHQwowyI6N+Rb+ETBYiZl1erb/AcbyT7 +oCb9DbtXYZ0WJBZKb3kPovwhp+e7HUrTZ+9AdFxgJdym2NidEsf5TRKZn+Qk7w0Y+Mw NV7v0ioy5sSR55FY9IH9QJilXHel9VrYphA03tT0hDk31+gb74Smuoy/6KqiRxEKO6q4 VPEBeTwmFZLBrtUVLvc2ALtFBuYDNWMZXoSUYvv1Q7+nytbtH+nRQZoaGaIzvlO2PzVl z+ymc/ViGTXhX5dJhV1avXuAUXa5j2KraVFLiD+AjEbKRHW/due5kHyuTcBONIpvv5Vn BFiA== X-Gm-Message-State: AOJu0YyyWP6xK5aiN96YqmMh4ANQHOeLKwt6y7v15+HjOC8rtXqg0QK6 sMcfuJce5ExH7dtf4gHunmtIlkBEBE9Qp9V+QYs= X-Received: by 2002:a67:f3d0:0:b0:44e:bc13:b761 with SMTP id j16-20020a67f3d0000000b0044ebc13b761mr1886156vsn.14.1695181388190; Tue, 19 Sep 2023 20:43:08 -0700 (PDT) MIME-Version: 1.0 References: <20230919045135.3635437-1-willy@infradead.org> <20230919045135.3635437-10-willy@infradead.org> In-Reply-To: <20230919045135.3635437-10-willy@infradead.org> From: Ryusuke Konishi Date: Wed, 20 Sep 2023 12:42:51 +0900 Message-ID: Subject: Re: [PATCH 09/26] nilfs2: Convert nilfs_mdt_freeze_buffer to use a folio To: "Matthew Wilcox (Oracle)" Cc: Andrew Morton , linux-fsdevel@vger.kernel.org, gfs2@lists.linux.dev, linux-nilfs@vger.kernel.org, linux-ntfs-dev@lists.sourceforge.net, ntfs3@lists.linux.dev, ocfs2-devel@lists.linux.dev, reiserfs-devel@vger.kernel.org, linux-ext4@vger.kernel.org, Pankaj Raghav Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.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 (agentk.vger.email [0.0.0.0]); Tue, 19 Sep 2023 20:43:15 -0700 (PDT) On Tue, Sep 19, 2023 at 6:09=E2=80=AFPM Matthew Wilcox (Oracle) wrote: > > Remove a number of folio->page->folio conversions. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > fs/nilfs2/mdt.c | 20 +++++++++++--------- > 1 file changed, 11 insertions(+), 9 deletions(-) > > diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c > index 19c8158605ed..db2260d6e44d 100644 > --- a/fs/nilfs2/mdt.c > +++ b/fs/nilfs2/mdt.c > @@ -560,17 +560,19 @@ int nilfs_mdt_freeze_buffer(struct inode *inode, st= ruct buffer_head *bh) > { > struct nilfs_shadow_map *shadow =3D NILFS_MDT(inode)->mi_shadow; > struct buffer_head *bh_frozen; > - struct page *page; > + struct folio *folio; > int blkbits =3D inode->i_blkbits; > > - page =3D grab_cache_page(shadow->inode->i_mapping, bh->b_folio->i= ndex); > - if (!page) > - return -ENOMEM; > + folio =3D filemap_grab_folio(shadow->inode->i_mapping, > + bh->b_folio->index); > + if (IS_ERR(folio)) > + return PTR_ERR(folio); > > - if (!page_has_buffers(page)) > - create_empty_buffers(page, 1 << blkbits, 0); > + bh_frozen =3D folio_buffers(folio); > + if (!bh_frozen) > + bh_frozen =3D folio_create_empty_buffers(folio, 1 << blkb= its, 0); > > - bh_frozen =3D nilfs_page_get_nth_block(page, bh_offset(bh) >> blk= bits); > + bh_frozen =3D get_nth_bh(bh_frozen, bh_offset(bh) >> blkbits); > > if (!buffer_uptodate(bh_frozen)) > nilfs_copy_buffer(bh_frozen, bh); > @@ -582,8 +584,8 @@ int nilfs_mdt_freeze_buffer(struct inode *inode, stru= ct buffer_head *bh) > brelse(bh_frozen); /* already frozen */ > } > > - unlock_page(page); > - put_page(page); > + folio_unlock(folio); > + folio_put(folio); > return 0; > } > > -- > 2.40.1 > Acked-by: Ryusuke Konishi Looks good to me. Thanks, Ryusuke Konishi