Skip to contentSkip to conversation

btrfs: use btrfs_is_data_reloc_root() where not done yet

PATCH In review David Sterba 2 participants 2 messages Jun 6, 2025 – Jun 11, 2025 Btrfs file system

lore
Share & tools
lore

David Sterba

author maintainer
#0 lore raw

PATCH 1/1 btrfs: use btrfs_is_data_reloc_root() where not done yet

Two remaining cases where we can use the helper.

---
 fs/btrfs/file-item.c | 2 +-
 fs/btrfs/inode.c     | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
fs/btrfs/file-item.c +1 -1
index 54d523d4f42126..c09fbc257634ab 100644
@@ -427,7 +427,7 @@ int btrfs_lookup_bio_sums(struct btrfs_bio *bbio)
 			memset(csum_dst, 0, csum_size);
 			count = 1;
 
-			if (btrfs_root_id(inode->root) == BTRFS_DATA_RELOC_TREE_OBJECTID) {
+			if (btrfs_is_data_reloc_root(inode->root)) {
 				u64 file_offset = bbio->file_offset + bio_offset;
 
 				btrfs_set_extent_bit(&inode->io_tree, file_offset,
fs/btrfs/inode.c +1 -1
index 00e7f98d97faaf..28c162174fac6f 100644
@@ -308,7 +308,7 @@ static void __cold btrfs_print_data_csum_error(struct btrfs_inode *inode,
 	const u32 csum_size = root->fs_info->csum_size;
 
 	/* For data reloc tree, it's better to do a backref lookup instead. */
-	if (btrfs_root_id(root) == BTRFS_DATA_RELOC_TREE_OBJECTID)
+	if (btrfs_is_data_reloc_root(root))
 		return print_data_reloc_error(inode, logical_start, csum,
 					      csum_expected, mirror_num);
 
Signature · 1 line
2.49.0