btrfs: use btrfs_is_data_reloc_root() where not done yet
authorDavid Sterba <dsterba@suse.com>
Fri, 6 Jun 2025 17:50:01 +0000 (19:50 +0200)
committerDavid Sterba <dsterba@suse.com>
Mon, 21 Jul 2025 21:53:31 +0000 (23:53 +0200)
Two remaining cases where we can use the helper.

Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file-item.c
fs/btrfs/inode.c

index 54d523d4f4212634b76e6f11fea79a4a3daad08b..c09fbc257634aba66eb4fb06bf06ba350a7c4693 100644 (file)
@@ -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,
index 317761f7c1c90b65e4eeeaa5cccae8dc8263516b..c2accf631f347720d2edfb9a6b08b9060c9ac1f7 100644 (file)
@@ -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);