aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.h
diff options
context:
space:
mode:
authorJohannes Thumshirn <johannes.thumshirn@wdc.com>2021-09-09 01:19:25 +0900
committerDavid Sterba <dsterba@suse.com>2021-10-26 19:08:01 +0200
commit37f00a6d2e9c97d6e7b5c3d47c49b714c3d0b99f (patch)
treeedac1c035442c95075e598b2efd14f66f858a12e /fs/btrfs/ctree.h
parentbtrfs: unexport repair_io_failure() (diff)
downloadlinux-dev-37f00a6d2e9c97d6e7b5c3d47c49b714c3d0b99f.tar.xz
linux-dev-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/ctree.h')
-rw-r--r--fs/btrfs/ctree.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index bfba85d9f862..f6e624098d53 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3846,6 +3846,11 @@ static inline bool btrfs_is_zoned(const struct btrfs_fs_info *fs_info)
return fs_info->zoned != 0;
}
+static inline bool btrfs_is_data_reloc_root(const struct btrfs_root *root)
+{
+ return root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID;
+}
+
/*
* We use page status Private2 to indicate there is an ordered extent with
* unfinished IO.