diff options
author | Johannes Thumshirn <johannes.thumshirn@wdc.com> | 2021-09-08 18:19:25 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2021-10-26 19:08:01 +0200 |
commit | 37f00a6d2e9c97d6e7b5c3d47c49b714c3d0b99f (patch) | |
tree | edac1c035442c95075e598b2efd14f66f858a12e /fs/btrfs/relocation.c | |
parent | btrfs: unexport repair_io_failure() (diff) | |
download | linux-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/relocation.c')
-rw-r--r-- | fs/btrfs/relocation.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c index 63d2b22cf438..e9e748925cc9 100644 --- a/fs/btrfs/relocation.c +++ b/fs/btrfs/relocation.c @@ -4390,8 +4390,7 @@ int btrfs_reloc_cow_block(struct btrfs_trans_handle *trans, if (!rc) return 0; - BUG_ON(rc->stage == UPDATE_DATA_PTRS && - root->root_key.objectid == BTRFS_DATA_RELOC_TREE_OBJECTID); + BUG_ON(rc->stage == UPDATE_DATA_PTRS && btrfs_is_data_reloc_root(root)); level = btrfs_header_level(buf); if (btrfs_header_generation(buf) <= |