diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-09-09 17:53:32 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-26 12:28:04 +0200 |
commit | 071d19f5130ff699fccf6b766dd6366f5d861da7 (patch) | |
tree | 39a42ef4cd7cb7948673a5ae8ed560474cd015f9 /fs/btrfs/extent-io-tree.c | |
parent | a4055213bf6912d850859f9166ee8016a557d4bf (diff) |
btrfs: remove struct tree_entry in extent-io-tree.c
This existed when we overloaded the tree manipulation functions for both
the extent_io_tree and the extent buffer tree. However the extent
buffers are now stored in a radix tree, so we no longer need this
abstraction. Remove struct tree_entry and use extent_state directly
instead.
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/extent-io-tree.c')
-rw-r--r-- | fs/btrfs/extent-io-tree.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/fs/btrfs/extent-io-tree.c b/fs/btrfs/extent-io-tree.c index 99cffa26b4e7..6b23d4d091c5 100644 --- a/fs/btrfs/extent-io-tree.c +++ b/fs/btrfs/extent-io-tree.c @@ -229,11 +229,11 @@ static inline struct rb_node *tree_search_for_insert(struct extent_io_tree *tree struct rb_root *root = &tree->state; struct rb_node **node = &root->rb_node; struct rb_node *prev = NULL; - struct tree_entry *entry; + struct extent_state *entry; while (*node) { prev = *node; - entry = rb_entry(prev, struct tree_entry, rb_node); + entry = rb_entry(prev, struct extent_state, rb_node); if (offset < entry->start) node = &(*node)->rb_left; @@ -251,7 +251,7 @@ static inline struct rb_node *tree_search_for_insert(struct extent_io_tree *tree /* Search neighbors until we find the first one past the end */ while (prev && offset > entry->end) { prev = rb_next(prev); - entry = rb_entry(prev, struct tree_entry, rb_node); + entry = rb_entry(prev, struct extent_state, rb_node); } return prev; @@ -278,14 +278,14 @@ static inline struct rb_node *tree_search_prev_next(struct extent_io_tree *tree, struct rb_node **node = &root->rb_node; struct rb_node *prev = NULL; struct rb_node *orig_prev = NULL; - struct tree_entry *entry; + struct extent_state *entry; ASSERT(prev_ret); ASSERT(next_ret); while (*node) { prev = *node; - entry = rb_entry(prev, struct tree_entry, rb_node); + entry = rb_entry(prev, struct extent_state, rb_node); if (offset < entry->start) node = &(*node)->rb_left; @@ -298,15 +298,15 @@ static inline struct rb_node *tree_search_prev_next(struct extent_io_tree *tree, orig_prev = prev; while (prev && offset > entry->end) { prev = rb_next(prev); - entry = rb_entry(prev, struct tree_entry, rb_node); + entry = rb_entry(prev, struct extent_state, rb_node); } *next_ret = prev; prev = orig_prev; - entry = rb_entry(prev, struct tree_entry, rb_node); + entry = rb_entry(prev, struct extent_state, rb_node); while (prev && offset < entry->start) { prev = rb_prev(prev); - entry = rb_entry(prev, struct tree_entry, rb_node); + entry = rb_entry(prev, struct extent_state, rb_node); } *prev_ret = prev; @@ -417,10 +417,10 @@ static int insert_state(struct extent_io_tree *tree, node = &tree->state.rb_node; while (*node) { - struct tree_entry *entry; + struct extent_state *entry; parent = *node; - entry = rb_entry(parent, struct tree_entry, rb_node); + entry = rb_entry(parent, struct extent_state, rb_node); if (end < entry->start) { node = &(*node)->rb_left; @@ -486,10 +486,10 @@ static int split_state(struct extent_io_tree *tree, struct extent_state *orig, parent = &orig->rb_node; node = &parent; while (*node) { - struct tree_entry *entry; + struct extent_state *entry; parent = *node; - entry = rb_entry(parent, struct tree_entry, rb_node); + entry = rb_entry(parent, struct extent_state, rb_node); if (prealloc->end < entry->start) { node = &(*node)->rb_left; |