diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-09-10 00:53:45 +0300 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-26 13:28:05 +0300 |
commit | 71528e9e16c7ade3771f5ef9387673580cb2db38 (patch) | |
tree | 2c17931732f3b2d3b39cb3bec962fbd7c18147ed /fs/btrfs | |
parent | 4374d03d21a9577c8536d78a941fba105143769d (diff) | |
download | linux-71528e9e16c7ade3771f5ef9387673580cb2db38.tar.xz |
btrfs: get rid of extent_io_tree::dirty_bytes
This was used as an optimization for count_range_bits(EXTENT_DIRTY),
which was used by the failed record code. However this was removed in
this series by patch "btrfs: convert the io_failure_tree to a plain
rb_tree" which was the last user of this optimization. Remove the
->dirty_bytes as nobody cares anymore.
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs')
-rw-r--r-- | fs/btrfs/extent-io-tree.c | 17 | ||||
-rw-r--r-- | fs/btrfs/extent-io-tree.h | 1 |
2 files changed, 1 insertions, 17 deletions
diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 02e9eda59cb7..c14e13388150 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -98,7 +98,6 @@ void extent_io_tree_init(struct btrfs_fs_info *fs_info, { tree->fs_info = fs_info; tree->state = RB_ROOT; - tree->dirty_bytes = 0; spin_lock_init(&tree->lock); tree->private_data = private_data; tree->owner = owner; @@ -378,10 +377,6 @@ static void set_state_bits(struct extent_io_tree *tree, if (tree->private_data && is_data_inode(tree->private_data)) btrfs_set_delalloc_extent(tree->private_data, state, bits); - if ((bits_to_set & EXTENT_DIRTY) && !(state->state & EXTENT_DIRTY)) { - u64 range = state->end - state->start + 1; - tree->dirty_bytes += range; - } ret = add_extent_changeset(state, bits_to_set, changeset, 1); BUG_ON(ret < 0); state->state |= bits_to_set; @@ -515,12 +510,6 @@ static struct extent_state *clear_state_bit(struct extent_io_tree *tree, u32 bits_to_clear = bits & ~EXTENT_CTLBITS; int ret; - if ((bits_to_clear & EXTENT_DIRTY) && (state->state & EXTENT_DIRTY)) { - u64 range = state->end - state->start + 1; - WARN_ON(range > tree->dirty_bytes); - tree->dirty_bytes -= range; - } - if (tree->private_data && is_data_inode(tree->private_data)) btrfs_clear_delalloc_extent(tree->private_data, state, bits); @@ -1515,10 +1504,7 @@ u64 count_range_bits(struct extent_io_tree *tree, return 0; spin_lock(&tree->lock); - if (cur_start == 0 && bits == EXTENT_DIRTY) { - total_bytes = tree->dirty_bytes; - goto out; - } + /* * This search will find all the extents that end after our range * starts. @@ -1544,7 +1530,6 @@ u64 count_range_bits(struct extent_io_tree *tree, } state = next_state(state); } -out: spin_unlock(&tree->lock); return total_bytes; } diff --git a/fs/btrfs/extent-io-tree.h b/fs/btrfs/extent-io-tree.h index 1c24a489471b..913d83a2eee7 100644 --- a/fs/btrfs/extent-io-tree.h +++ b/fs/btrfs/extent-io-tree.h @@ -69,7 +69,6 @@ struct extent_io_tree { struct rb_root state; struct btrfs_fs_info *fs_info; void *private_data; - u64 dirty_bytes; /* Who owns this io tree, should be one of IO_TREE_* */ u8 owner; |