summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-tree.c
diff options
context:
space:
mode:
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>2021-09-08 18:19:25 +0200
committerDavid Sterba <dsterba@suse.com>2021-10-26 19:08:01 +0200
commit37f00a6d2e9c97d6e7b5c3d47c49b714c3d0b99f (patch)
treeedac1c035442c95075e598b2efd14f66f858a12e /fs/btrfs/extent-tree.c
parentbtrfs: unexport repair_io_failure() (diff)
downloadlinux-37f00a6d2e9c97d6e7b5c3d47c49b714c3d0b99f.tar.xz
linux-37f00a6d2e9c97d6e7b5c3d47c49b714c3d0b99f.zip
btrfs: introduce btrfs_is_data_reloc_root
There are several places in our codebase where we check if a root is the root of the data reloc tree and subsequent patches will introduce more. Factor out the check into a small helper function instead of open coding it multiple times. Reviewed-by: Naohiro Aota <naohiro.aota@wdc.com> Signed-off-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/extent-tree.c')
-rw-r--r--fs/btrfs/extent-tree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c
index 9aa429a9a235..74ac37c5f218 100644
--- a/fs/btrfs/extent-tree.c
+++ b/fs/btrfs/extent-tree.c
@@ -2376,7 +2376,7 @@ int btrfs_cross_ref_exist(struct btrfs_root *root, u64 objectid, u64 offset,
out:
btrfs_free_path(path);
- if (root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID)
+ if (btrfs_is_data_reloc_root(root))
WARN_ON(ret > 0);
return ret;
}