Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp445269rdb; Mon, 18 Sep 2023 23:13:57 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHa2R6AxLZfuHxCHjvVi3G+LLWje16URN7Ta+sLae9erds7XoCt7BH7F+jKyzKtgv3fhY87 X-Received: by 2002:a05:6808:2006:b0:3a9:bc8d:42c3 with SMTP id q6-20020a056808200600b003a9bc8d42c3mr13792866oiw.50.1695104036943; Mon, 18 Sep 2023 23:13:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695104036; cv=none; d=google.com; s=arc-20160816; b=TyoQrYtmAYtcEIoCSQ17GHdoE+tF3L2y0PeoCogXhD85YKLWBu1hKCPJxRwXkncCrW ixJu/d8U+y9G+iesqOIEBRZ5/M9N4yDYLGGrbFQ+mjPuVDV4Q6lJ4Y7KYdbQx0u9Kaup QwIlsd4CZaje8z4BVr+4wq9J9+VjPmALtjXnnJAE27ZzCl4N4Pe/A6qhnHxW+rtEZ58K NuyKkqOpAgeIgLFPeECJBjCp/AmjLVaUCR5+aZSF13ZTUg6Jha31dW5/igM8CMLbtBH8 TxalV8WOFKIlejGoP+yBGutlm3CPvQ/pdmNqn4V5kY9weT2m/5agQJ4RDUQe5erslx+5 eArw== 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=1TQFktAQGh0zDqA+GJQVLyWb3smQ1H0QN8aDeY770F0=; fh=Ex900LeWemyNv8v7eVaT25lhS5hAbxvedq4sD5vnIX8=; b=e/rLGH7MDG1GTMg3W52Xu2tLQd1WxCdMihjFk50QvJjqaj9lm73qSPxO85SXs/RFX7 dIuJkc9t4ubSfn5R9PE/TiJDGEhI7ocNQ0Y5FMSW27K8eiVavtoBOveSfO66U7NuSD2T TfR+wkwkM60Bp1cbna38LN6OtkNXWKj5e6yH6FxegNOOvJC6c2VfwWVFpGGq6DNtv1HC LQ/aVFs9YUriIrmqOzDqVgUiW1tC7EwJZ/gEFwaqIQls0+DvE7v9EOZ8zVEHpSLz6t1n lTd0w/xIT3lfFHUaRcMMkn4F1RUd4J4VT7D4VFTJ2zUe7WO1K+rz34uQcTnzkiqQOZ6A 3lfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=PxHiF6ck; 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 u69-20020a638548000000b00569161a1884si9024302pgd.194.2023.09.18.23.13.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 23:13:56 -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=PxHiF6ck; 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 E29298034668; Mon, 18 Sep 2023 21:51:53 -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 S231547AbjISEvz (ORCPT + 99 others); Tue, 19 Sep 2023 00:51:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231537AbjISEvr (ORCPT ); Tue, 19 Sep 2023 00:51:47 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9638610F; Mon, 18 Sep 2023 21:51:41 -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=1TQFktAQGh0zDqA+GJQVLyWb3smQ1H0QN8aDeY770F0=; b=PxHiF6cktFd/+CJWwFu4VfrtIM PU0/626kh0C0ccZjcHWLIbaeSrDKQSavppRX9DRoE01nHmzI0HlowA9/DqHak5U+KPUXKjQOdJsMs ZdwfK6M84AaKO9czXr1z7XfamvIK16jDsF+5FVERFeDeCp8meD7EpMpnB1ZpZfBurluqv/wWqIQ9i QrQ+B/blKNm3erh45AQnHTEWTOxqp2w0H0iFhdgfFEPkO9daOJuNfy5L7uoCrQdv+ULCTdbsbDSn0 VsYB0iwbBHo3ho/jG4t1edo/ibYE4JPT0lVSSVCNpJvJ4DFaYIkEKiH/kWvwbRREVnyH8qtiMOMoD 4z+k4GNw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qiSi3-00FFl8-RD; Tue, 19 Sep 2023 04:51:39 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , 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 Subject: [PATCH 13/26] nilfs2: Convert nilfs_mdt_get_frozen_buffer to use a folio Date: Tue, 19 Sep 2023 05:51:22 +0100 Message-Id: <20230919045135.3635437-14-willy@infradead.org> X-Mailer: git-send-email 2.37.1 In-Reply-To: <20230919045135.3635437-1-willy@infradead.org> References: <20230919045135.3635437-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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]); Mon, 18 Sep 2023 21:51:54 -0700 (PDT) Remove a number of folio->page->folio conversions. Signed-off-by: Matthew Wilcox (Oracle) --- fs/nilfs2/mdt.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index 11b7cf4acc92..7b754e6494d7 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c @@ -592,17 +592,19 @@ nilfs_mdt_get_frozen_buffer(struct inode *inode, struct buffer_head *bh) { struct nilfs_shadow_map *shadow = NILFS_MDT(inode)->mi_shadow; struct buffer_head *bh_frozen = NULL; - struct page *page; + struct folio *folio; int n; - page = find_lock_page(shadow->inode->i_mapping, bh->b_folio->index); - if (page) { - if (page_has_buffers(page)) { + folio = filemap_lock_folio(shadow->inode->i_mapping, + bh->b_folio->index); + if (!IS_ERR(folio)) { + bh_frozen = folio_buffers(folio); + if (bh_frozen) { n = bh_offset(bh) >> inode->i_blkbits; - bh_frozen = nilfs_page_get_nth_block(page, n); + bh_frozen = get_nth_bh(bh_frozen, n); } - unlock_page(page); - put_page(page); + folio_unlock(folio); + folio_put(folio); } return bh_frozen; } -- 2.40.1