Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp555778rdb; Tue, 19 Sep 2023 03:46:08 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH7Qj0o5nNJDKOz5LZIkjewEFlQ9QMq5XiQPQOrRaPcBnY856AbN9KQyNatsndDvSUURoxN X-Received: by 2002:a17:902:b901:b0:1b8:6987:de84 with SMTP id bf1-20020a170902b90100b001b86987de84mr12299338plb.48.1695120368218; Tue, 19 Sep 2023 03:46:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695120368; cv=none; d=google.com; s=arc-20160816; b=Iah4QRW5jTHAAbwQ36ayKwrcIKf0CYaQsD4/3jWOM4+1urpJvoOteECRxqpd1zPo6v f6ANnGKfLMVSBzPD14e7hI1JIHPox9urO5fyOH+fal3MRBItx4kibamzsQY4fjWUwvjC oV3AsJDDHxilirr1b2veQWy/fbQ1PmLAJA0MWhdNtzWtGRYS1b7xQzh+pZZQ38S1HNvP ewPEkEbmbZvf8uCLMUC2eivtVItFSqyYERbkoUsD035u689BQFDwteSyDtPoGaYS2A2Z hgM7ils1LqjdP9vj5x0GXnAtBox6DobtvovVNa04mB3+rx9Nek72B3VroPBHGWw49yDq vaGg== 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=+wTdVqWyKgBbS+9qDOyV58Ls9Ihpcoj+lHfeR43k9+Q=; fh=Ex900LeWemyNv8v7eVaT25lhS5hAbxvedq4sD5vnIX8=; b=wGNRHocJUbzHc6iGmEP9T1NpkBJHFd/WV6jkfKyYUfGx+UVSZNxOJGn6WHPpGMiQCf FGNQVyXLmKFKF09eo2KXg/vS5CTUo2Uud09R5y685Pmw0eA3/zh9Tju89SMLBCq4UqvQ M85QzYN+SbMSQVDl62h2euUJU/g542HgImKu1IZ/6FQdoDT/pj5iCW2KPxflnRo1q/PU UgpxaVTwVTO+5+Gm6DEGOMTBNpxqokoJvmxes9xumfF9XOZwxa7aaOhaah9oqv9qQGZb 8GvW9iSGc4QWHFcyyJxxLY9Tt2aHG3QwTReJUAQeC4oyUYuvIhPcuJPmuunc1AnbqqL5 LI6g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b="EjS/viga"; 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 b13-20020a170902d50d00b001b9c3498510si9822715plg.469.2023.09.19.03.46.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 03:46: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="EjS/viga"; 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 1AEA4822CB21; Mon, 18 Sep 2023 21:52:10 -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 S231584AbjISEvx (ORCPT + 99 others); Tue, 19 Sep 2023 00:51:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231547AbjISEvr (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 0D2C712B; 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=+wTdVqWyKgBbS+9qDOyV58Ls9Ihpcoj+lHfeR43k9+Q=; b=EjS/vigaWbpkvkGHq21vO/7U48 RQAWODt7t/VES3aBpMUIwR5YYN4T23Yijfp7DzSe3jp7TMySxccYDilu/C061YO7Zvc0Xa3XEZyqo vEJu89mX7GcmDNPthus4SryoavJutE7J0LgWie/fLkRXsjbJUu3wQh/lPGBQUlNpuvOLAl9UrE4wq 264M38IuMR/1qDkHqrVxNpEMOf5yoOxuScr1xdtx+m4K74BNZY1OZy6yYHJ88XEuTDGSGnUOvsV2t 5NwNAEnwlWO6I0eqbfEKWozrz2UvMdvXUfr3KhMwTOIxkj9zlT0wcwyqC+S7pv1+v8WPIT8eAEeBF KvQqUDCg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1qiSi3-00FFko-CC; 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 10/26] nilfs2: Convert nilfs_grab_buffer() to use a folio Date: Tue, 19 Sep 2023 05:51:19 +0100 Message-Id: <20230919045135.3635437-11-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 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]); Mon, 18 Sep 2023 21:52:10 -0700 (PDT) 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 index, - 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 = folio_buffers(folio); - if (!page_has_buffers(page)) - create_empty_buffers(page, 1 << blkbits, b_state); + if (!bh) + bh = folio_create_empty_buffers(folio, 1 << blkbits, b_state); first_block = (unsigned long)index << (PAGE_SHIFT - blkbits); - bh = nilfs_page_get_nth_block(page, block - first_block); + bh = 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 *inode, { int blkbits = inode->i_blkbits; pgoff_t index = blkoff >> (PAGE_SHIFT - blkbits); - struct page *page; + struct folio *folio; struct buffer_head *bh; - page = grab_cache_page(mapping, index); - if (unlikely(!page)) + folio = filemap_grab_folio(mapping, index); + if (IS_ERR(folio)) return NULL; - bh = __nilfs_get_page_block(page, blkoff, index, blkbits, b_state); + bh = __nilfs_get_folio_block(folio, blkoff, index, blkbits, b_state); if (unlikely(!bh)) { - unlock_page(page); - put_page(page); + folio_unlock(folio); + folio_put(folio); return NULL; } return bh; -- 2.40.1