summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/extent-io-tree.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2022-09-09 17:53:21 -0400
committerDavid Sterba <dsterba@suse.com>2022-09-26 12:28:03 +0200
commit83cf709a89fb97e78e60f310ea5f2b283e0f581c (patch)
treec5f8ecad62becd1645d2e54efcd4a00db60bf97a /fs/btrfs/extent-io-tree.h
parentc45379a20fbcbbd166966711cf9481ecb41b8271 (diff)
downloadlinux-83cf709a89fb97e78e60f310ea5f2b283e0f581c.tar.gz
linux-83cf709a89fb97e78e60f310ea5f2b283e0f581c.tar.bz2
linux-83cf709a89fb97e78e60f310ea5f2b283e0f581c.zip
btrfs: move extent state init and alloc functions to their own file
Start cleaning up extent_io.c by moving the extent state code out of it. This patch starts with the extent state allocation code and the extent_io_tree init code. 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.h')
-rw-r--r--fs/btrfs/extent-io-tree.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/btrfs/extent-io-tree.h b/fs/btrfs/extent-io-tree.h
index 8e7a548b88e9..56266e75b4fe 100644
--- a/fs/btrfs/extent-io-tree.h
+++ b/fs/btrfs/extent-io-tree.h
@@ -253,4 +253,9 @@ int btrfs_clean_io_failure(struct btrfs_inode *inode, u64 start,
struct extent_state *alloc_extent_state_atomic(struct extent_state *prealloc);
struct extent_state *alloc_extent_state(gfp_t mask);
+static inline bool extent_state_in_tree(const struct extent_state *state)
+{
+ return !RB_EMPTY_NODE(&state->rb_node);
+}
+
#endif /* BTRFS_EXTENT_IO_TREE_H */