From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4DCA0156C6A for ; Sun, 9 Aug 2026 01:26:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786238805; cv=none; b=IKoDnQYY+0yfkhngBnthYEYOYG8z8uKHQMskcQP5xI5+3mEAPWJrMC1/5R3CXg9+b9vlNqSObXwabCWOKZNOUPvwkAgQ8fsc3ulomB7MEvo5SyMv2H4NQ5RDLEIna6zoJZLY6uW2LaxsNfmALQnNVDBugxsUqM3+SZHJOIEurP8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786238805; c=relaxed/simple; bh=jZgygD34XIPuC9PffwUy+E0wDh+fgM6qp/KHTK6KNHM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=eoSlEIptrCeBQaVOVnqAdZ3QdWHmNEhNsQjfpwrJq7WG4PonWvROvuNSf6+xKdVu+/iod1XnZ1SsnEGh/EXzmg5OLwBNYsgegmedYVnadsMLF1UrrLsWtkOGnXPoJfDUK6HpjBxtajCnxqjhXD0gNnO9aQSGKC2k036fKrtgWHU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=P6mAYJN5; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="P6mAYJN5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0C6A31F000E9; Sun, 9 Aug 2026 01:26:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1786238804; bh=0P3R1S9d9BIx0saTISwv8bViwUT39u5atC0yHBfq0jM=; h=From:To:Cc:Subject:Date; b=P6mAYJN5ZhKzWpMwtZC7s37N696SIhcfc9+97clZn6AV7V2OkV6oiG9w8Rc9bOHHP 6XBGFBptGft5nSbZ5F3U+hJWkxp4I75+klh0/6Tys21vsE1Y3fMbZ21cCo8G1rE8L4 F4b9303XID8S1K+TDCZtbqgSoQg5FHZzlzC9YdmTqRDnLShZjxWm/Unv4CN8nVmrpu 8O+UWTFX4NvV1gT4EiDUFByOrhaiEqFbfUASKut2rAT+H7Omkveo2tLjPiHMs/r0Uo kOh/jbtmpIkVub8cDRxEkkOrvFI/Px2NyowXIUM7YlmjFIDrqV/xeHjz9hHX8tBLdt U+H1eDTPab/SA== From: Chao Yu To: jaegeuk@kernel.org Cc: linux-f2fs-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org, Chao Yu Subject: [PATCH v2 1/2] f2fs: unify add/remove ino entry API for all ino types Date: Sun, 9 Aug 2026 09:26:38 +0800 Message-ID: <20260809012639.568485-1-chao@kernel.org> X-Mailer: git-send-email 2.55.0.654.g21b8a5bc05-goog Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit - Call f2fs_add_ino_entry() and f2fs_remove_ino_entry() for ORPHAN_INO - introduce __f2fs_add_ino_entry() to wrap __add_ino_entry(), so that both f2fs_add_ino_entry() and f2fs_set_dirty_device() will call __f2fs_add_ino_entry(). So, after this change: add delete lookup ORPHAN_INO f2fs_add_ino_entry f2fs_remove_ino_entry N/A FLUSH_INO f2fs_set_dirty_device f2fs_remove_ino_entry f2fs_is_dirty_device APPEND_INO f2fs_add_ino_entry f2fs_remove_ino_entry f2fs_exist_written_data UPDATA_INO f2fs_add_ino_entry f2fs_remove_ino_entry f2fs_exist_written_data TRANS_DIR_INO f2fs_add_ino_entry N/A f2fs_exist_written_data XATTR_DIR_INO f2fs_add_ino_entry N/A f2fs_exist_written_data Signed-off-by: Chao Yu --- fs/f2fs/checkpoint.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c index 4413eccb5ecb..eb2f955b1e2a 100644 --- a/fs/f2fs/checkpoint.c +++ b/fs/f2fs/checkpoint.c @@ -775,10 +775,16 @@ static void f2fs_wait_for_inode_record(struct f2fs_sb_info *sbi, int mode) flush_workqueue(sbi->evict_wq); } -void f2fs_add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type) +static void __f2fs_add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, + unsigned int devidx, int type) { /* add new dirty ino entry into list */ - __add_ino_entry(sbi, ino, 0, type); + __add_ino_entry(sbi, ino, devidx, type); +} + +void f2fs_add_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type) +{ + __f2fs_add_ino_entry(sbi, ino, 0, type); } void f2fs_remove_ino_entry(struct f2fs_sb_info *sbi, nid_t ino, int type) @@ -823,7 +829,7 @@ void f2fs_release_ino_entry(struct f2fs_sb_info *sbi, bool all) void f2fs_set_dirty_device(struct f2fs_sb_info *sbi, nid_t ino, unsigned int devidx, int type) { - __add_ino_entry(sbi, ino, devidx, type); + __f2fs_add_ino_entry(sbi, ino, devidx, type); } bool f2fs_is_dirty_device(struct f2fs_sb_info *sbi, nid_t ino, @@ -875,14 +881,14 @@ void f2fs_release_orphan_inode(struct f2fs_sb_info *sbi) void f2fs_add_orphan_inode(struct inode *inode) { /* add new orphan ino entry into list */ - __add_ino_entry(F2FS_I_SB(inode), inode->i_ino, 0, ORPHAN_INO); + f2fs_add_ino_entry(F2FS_I_SB(inode), inode->i_ino, ORPHAN_INO); f2fs_update_inode_page(inode); } void f2fs_remove_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino) { /* remove orphan entry from orphan list */ - __remove_ino_entry(sbi, ino, ORPHAN_INO); + f2fs_remove_ino_entry(sbi, ino, ORPHAN_INO); } static int recover_orphan_inode(struct f2fs_sb_info *sbi, nid_t ino) -- 2.49.0