Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp1422571rdb; Wed, 20 Sep 2023 08:42:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGyzBvl5C4gSdbZRTRtCUvJ7cz2yr2Wis4HJmfkY0ftGYpHplegyxkbUy3WZek/kL/rYmee X-Received: by 2002:a05:6a00:1827:b0:68a:3b39:a486 with SMTP id y39-20020a056a00182700b0068a3b39a486mr3438787pfa.24.1695224529106; Wed, 20 Sep 2023 08:42:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695224529; cv=none; d=google.com; s=arc-20160816; b=YW1fiGg5bUEHqawitstEiqi/3hXb7YnG8bOU8RsEzhJrWWEcVNROSk3++V1VnJxdFG QEg55VKRzYdqL1MEJ30AgoEmjs7eN3zkIqwBVVnUmaq2yLx8C18CSXk5m3vTakVrn2Rn 6Knzc/nmpQQFD/+AeigZoVn8vhT+zaoVYPOiZ3uCcf1P4IlH9yYXr6XsOO0vSIacFp9H lH637EXYdFZJmogdgAaeaTfobpjbrWDAIwi8NmA4HQcVqmL/K+7fv7/jq4fyt8QvBbEw ovweJtivBfrfJgaIL+T/eiTo3ipe0463Jac5WOTcSplmo2T28VXl2sZl1cOqn8SFKoMS RJCg== 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=n0rt7w3e82POtgPKP1THsIMl2ekopUlVw4b9tDepiWE=; fh=sRR9gJ37ChtesxPb1iPEABChem0KgDKda8d5/HUMrrk=; b=RRMI0gc4csx2BTiWUOGYH/k+OGrhSVoDgkZsCLRg5FL/jSKVeO21iS+pVODImsPQrd X9uV2AwLdT2jdmXZ4RvY24w4pRpBEN7qKH0mreGbKQawBUMtFZfxft4eGsD3ceH68Jqs HTNMxMO5DD5sVX8jEU6Q8RgezSlmG3bSi+UTr/BT79VQ8bG81Yxy9gHMY0RYp1JAnqWB ZM7J4DMItLfOPsbib3nXYuvhPTibPsOS0BKQR3bNyWWAIk/zYb8eSX13v9IVFsgSqNAS Y1J7HDEfUaRQw+JiYzDT0xE+HqVIXXpLxKe119nWUk4CBrrrYBPwES6TToWmlOJOIkUI VJUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=N1oBJ5Pk; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (morse.vger.email. [2620:137:e000::3:1]) by mx.google.com with ESMTPS id b2-20020a633402000000b0056ad01ddc36si2438216pga.509.2023.09.20.08.42.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 20 Sep 2023 08:42:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:1 as permitted sender) client-ip=2620:137:e000::3:1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=N1oBJ5Pk; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::3:1 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 morse.vger.email (Postfix) with ESMTP id 50132824BAF7; Tue, 19 Sep 2023 21:14:09 -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 S231936AbjITEOL (ORCPT + 99 others); Wed, 20 Sep 2023 00:14:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43220 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232658AbjITEOJ (ORCPT ); Wed, 20 Sep 2023 00:14:09 -0400 Received: from mail-ua1-x92b.google.com (mail-ua1-x92b.google.com [IPv6:2607:f8b0:4864:20::92b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B515B0; Tue, 19 Sep 2023 21:14:03 -0700 (PDT) Received: by mail-ua1-x92b.google.com with SMTP id a1e0cc1a2514c-7ab30cee473so386116241.2; Tue, 19 Sep 2023 21:14:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695183242; x=1695788042; 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=n0rt7w3e82POtgPKP1THsIMl2ekopUlVw4b9tDepiWE=; b=N1oBJ5Pk69IwRoTdPPZCfX9w3ms0bY00XHcPHEPZybptv3sEY3PN3e6Q8RAAaL8LEz vzIs7cljTd46Qs3L8ACG3gtSEkCn/ndQtUvrbJQt1q+Joe7zhMAWhlccpC9zI2/sTDHH AXebXcciG2wUzL41ekKy/OBrT4+hpe9Fr8qIFcSIB9Ccwh9VOO4q48Vq2C3tv3s1xIOJ uD4qys+Var6IChL2PXvwULFP/zDoa31jGQsfgMGOdySEyQrMo6yLWACr/P/xak9aGleV vKmkCLVHe58WjFC1Y+cJMA9p93e0FPYELvSLHNoI50ly97SaKVt1fIsSyXsSzmBOYd3/ Z8Rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695183242; x=1695788042; 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=n0rt7w3e82POtgPKP1THsIMl2ekopUlVw4b9tDepiWE=; b=BOdYyVkbJXdpKp7JS8u8dn6dOBoRe3mWEmIVd7zAocb/17UGmgFrkalO5DZSYulTNv dTBFqKi8/qN2Fv5dc1s1XQQ5zA4XOUu1lM8bOUSe/Cr3yCz1lbb7zewI4UCGe7Dn6vJc tlM/un07bM/gAznuLA80uZ+DF/Sy3uUxIPVFnEV+K1MPr2gBqoGygowLIF0HanjfrcTU ZjBjPIw07v1uqa2c2mRmigu8oO2dguUnHC0fuVaKUdudo+WZeMN1d2mcOoUyPRrU2A0l cR4nTwl7lv8H7abDRMIKoJXPSxGB+D+0wJOE/nQaHO1ZsX1pw02YoaJmpS6SE8nFp+5f ju3A== X-Gm-Message-State: AOJu0YzEhEHssPX6FZrMUoWo+kxLaZ332VUX8t/onI6mmF562tnooEwR /lZ35B5CMGlUQRJyDkMQIFocHe8hrgR9ikgm5wg= X-Received: by 2002:a05:6102:184:b0:452:635b:8440 with SMTP id r4-20020a056102018400b00452635b8440mr1509703vsq.30.1695183242192; Tue, 19 Sep 2023 21:14:02 -0700 (PDT) MIME-Version: 1.0 References: <20230919045135.3635437-1-willy@infradead.org> <20230919045135.3635437-11-willy@infradead.org> In-Reply-To: <20230919045135.3635437-11-willy@infradead.org> From: Ryusuke Konishi Date: Wed, 20 Sep 2023 13:13:45 +0900 Message-ID: Subject: Re: [PATCH 10/26] nilfs2: Convert nilfs_grab_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 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]); Tue, 19 Sep 2023 21:14:09 -0700 (PDT) On Tue, Sep 19, 2023 at 7:20=E2=80=AFPM Matthew Wilcox (Oracle) wrote: > > Remove a number of folio->page->folio conversions. > > Signed-off-by: Matthew Wilcox (Oracle) > --- > fs/nilfs2/page.c | 26 +++++++++++++------------- > 1 file changed, 13 insertions(+), 13 deletions(-) > > diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c > index b4e54d079b7d..1c075bd906c9 100644 > --- a/fs/nilfs2/page.c > +++ b/fs/nilfs2/page.c > @@ -25,19 +25,19 @@ > (BIT(BH_Uptodate) | BIT(BH_Mapped) | BIT(BH_NILFS_Node) | \ > BIT(BH_NILFS_Volatile) | BIT(BH_NILFS_Checked)) > > -static struct buffer_head * > -__nilfs_get_page_block(struct page *page, unsigned long block, pgoff_t i= ndex, > - int blkbits, unsigned long b_state) > +static struct buffer_head *__nilfs_get_folio_block(struct folio *folio, > + unsigned long block, pgoff_t index, int blkbits, > + unsigned long b_state) > > { > unsigned long first_block; > - struct buffer_head *bh; > + struct buffer_head *bh =3D folio_buffers(folio); > > - if (!page_has_buffers(page)) > - create_empty_buffers(page, 1 << blkbits, b_state); > + if (!bh) > + bh =3D folio_create_empty_buffers(folio, 1 << blkbits, b_= state); > > first_block =3D (unsigned long)index << (PAGE_SHIFT - blkbits); > - bh =3D nilfs_page_get_nth_block(page, block - first_block); > + bh =3D get_nth_bh(bh, block - first_block); > > touch_buffer(bh); > wait_on_buffer(bh); > @@ -51,17 +51,17 @@ struct buffer_head *nilfs_grab_buffer(struct inode *i= node, > { > int blkbits =3D inode->i_blkbits; > pgoff_t index =3D blkoff >> (PAGE_SHIFT - blkbits); > - struct page *page; > + struct folio *folio; > struct buffer_head *bh; > > - page =3D grab_cache_page(mapping, index); > - if (unlikely(!page)) > + folio =3D filemap_grab_folio(mapping, index); > + if (IS_ERR(folio)) > return NULL; > > - bh =3D __nilfs_get_page_block(page, blkoff, index, blkbits, b_sta= te); > + bh =3D __nilfs_get_folio_block(folio, blkoff, index, blkbits, b_s= tate); > if (unlikely(!bh)) { > - unlock_page(page); > - put_page(page); > + folio_unlock(folio); > + folio_put(folio); > return NULL; > } > return bh; > -- > 2.40.1 > Acked-by: Ryusuke Konishi Looks good to me. Thanks, Ryusuke Konishi