From patchwork Tue Aug 20 03:46:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chao Yu X-Patchwork-Id: 13769282 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 EB191C5320E for ; Tue, 20 Aug 2024 03:47:28 +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 1sgFqC-0007x2-KR; Tue, 20 Aug 2024 03:47:28 +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 1sgFqB-0007wn-0L for linux-f2fs-devel@lists.sourceforge.net; Tue, 20 Aug 2024 03:47:27 +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=AlKtkv71Y5dMQWzz+ZZduEIH4qLJToicukWYZuVv5KY=; b=LgxCfbyMpq83osqoQjA2ZnHzPR E09J3SJz1c9r20JGq9cA7ykCT124CE8Lhr9Wo1e5KILSHAT91ZtDvYxBN3ZwPi8iv3hlzK1Wlb9+v BG9HhA1rZSQ8kldd1lIwbWuR3o7w/LKUy3/Scx2kX5aXTtXRbL0l4wjnMuK5LefYAGec=; 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=AlKtkv71Y5dMQWzz+ZZduEIH4qLJToicukWYZuVv5KY=; b=lW6PoER2+ANFDa7Wd6l9BQUspI 52D59cf9mztNJYoVpCe0RznPWMQAf92hJs40TjtFwja3qfr/WCoIAWzO0J3H5yajYi96XB7GGnKLN CiV9uwILliGMi05BcgMXfjXuH+43yKiBIvvPIWPaddwqZt9p8VnpM8DKZEEIIGCvqDfc=; Received: from dfw.source.kernel.org ([139.178.84.217]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1sgFqA-0006S3-Dc for linux-f2fs-devel@lists.sourceforge.net; Tue, 20 Aug 2024 03:47:26 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 1179C60DBA; Tue, 20 Aug 2024 03:47:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76045C4AF0C; Tue, 20 Aug 2024 03:47:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1724125635; bh=B1fWIi1dMz6E5T95/Mb2Eyi2qqkYJmzRfHyiW0GG3tk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xg5qHpCcZ7aZMUBVxcD9o+fzCzp+3g9YtDREFHkt2qMKKjxFESs/1Kg5SUoIuJQ4b yjDCtBUlxGzmNCdm0qNcZgiAS8P6sn90N7vcHvlzmMevIXSexZLbEetRs80kKkkvFe 8dZS59Thq8wTQzcPqy/dF90kMu1JLHNJvYgXcDmVEW3IAzHZfQ3lsIbIUUc/H4WaON ZoSRWdgDMcCybzV/LsAOluArn6lf3AqW7UQPnZW+MM+PwvuRDcFSMWb2PxSu6jjOGm 3xKzEbxQ799w/8YQXDOESZAYTW2HcWIgRU4l2UoZrUou1na3SORw/8YLwMD/N0gF7Y 5pnYGw+o33/hw== From: Chao Yu To: jaegeuk@kernel.org Date: Tue, 20 Aug 2024 11:46:53 +0800 Message-Id: <20240820034654.698236-7-chao@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20240820034654.698236-1-chao@kernel.org> References: <20240820034654.698236-1-chao@kernel.org> MIME-Version: 1.0 X-Headers-End: 1sgFqA-0006S3-Dc Subject: [f2fs-dev] [PATCH v2 7/8] f2fs: convert read_node_page() to use folio 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: linux-kernel@vger.kernel.org, Matthew Wilcox , linux-f2fs-devel@lists.sourceforge.net Errors-To: linux-f2fs-devel-bounces@lists.sourceforge.net Convert to use folio, so that we can get rid of 'page->index' to prepare for removal of 'index' field in structure page [1]. [1] https://lore.kernel.org/all/Zp8fgUSIBGQ1TN0D@casper.infradead.org/ Cc: Matthew Wilcox Signed-off-by: Chao Yu --- fs/f2fs/node.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index aeda3eecc9e2..f5e5abce695b 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1369,6 +1369,7 @@ struct page *f2fs_new_node_page(struct dnode_of_data *dn, unsigned int ofs) */ static int read_node_page(struct page *page, blk_opf_t op_flags) { + struct folio *folio = page_folio(page); struct f2fs_sb_info *sbi = F2FS_P_SB(page); struct node_info ni; struct f2fs_io_info fio = { @@ -1381,21 +1382,21 @@ static int read_node_page(struct page *page, blk_opf_t op_flags) }; int err; - if (PageUptodate(page)) { + if (folio_test_uptodate(folio)) { if (!f2fs_inode_chksum_verify(sbi, page)) { - ClearPageUptodate(page); + folio_clear_uptodate(folio); return -EFSBADCRC; } return LOCKED_PAGE; } - err = f2fs_get_node_info(sbi, page->index, &ni, false); + err = f2fs_get_node_info(sbi, folio->index, &ni, false); if (err) return err; /* NEW_ADDR can be seen, after cp_error drops some dirty node pages */ if (unlikely(ni.blk_addr == NULL_ADDR || ni.blk_addr == NEW_ADDR)) { - ClearPageUptodate(page); + folio_clear_uptodate(folio); return -ENOENT; }