diff options
author | Josef Bacik <josef@toxicpanda.com> | 2023-08-23 10:33:00 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2023-10-03 01:11:57 +0200 |
commit | a38570f9d6c0a90b1edbc9a3450e2fcf4c7521bc (patch) | |
tree | 10a69a472a73bc6d9b03ef8a36cbf200618800cc /tune | |
parent | 909bde13f445d8afe144af6e1fb12b38f1ace424 (diff) | |
download | btrfs-progs-a38570f9d6c0a90b1edbc9a3450e2fcf4c7521bc.tar.gz |
btrfs-progs: use btrfs_tree_parent_check for btrfs_read_extent_buffer
In the kernel we have a control structure call btrfs_tree_parent_check
to pass around the various sanity checks we have for extent buffers.
Add this to btrfs_tree_parent_check and then update the callers.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'tune')
-rw-r--r-- | tune/change-csum.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/tune/change-csum.c b/tune/change-csum.c index cf895df7..f12a2832 100644 --- a/tune/change-csum.c +++ b/tune/change-csum.c @@ -24,6 +24,7 @@ #include "kernel-shared/file-item.h" #include "kernel-shared/extent_io.h" #include "kernel-shared/transaction.h" +#include "kernel-shared/tree-checker.h" #include "common/messages.h" #include "common/internal.h" #include "common/utils.h" @@ -494,6 +495,7 @@ static int rewrite_tree_block_csum(struct btrfs_fs_info *fs_info, u64 logical, u16 new_csum_type) { struct extent_buffer *eb; + struct btrfs_tree_parent_check check = { 0 }; u8 result_old[BTRFS_CSUM_SIZE]; u8 result_new[BTRFS_CSUM_SIZE]; int ret; @@ -502,7 +504,7 @@ static int rewrite_tree_block_csum(struct btrfs_fs_info *fs_info, u64 logical, if (!eb) return -ENOMEM; - ret = btrfs_read_extent_buffer(eb, 0, 0, NULL); + ret = btrfs_read_extent_buffer(eb, &check); if (ret < 0) { errno = -ret; error("failed to read tree block at logical %llu: %m", logical); |