diff options
author | Josef Bacik <josef@toxicpanda.com> | 2022-09-09 17:53:21 -0400 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2022-09-26 12:28:03 +0200 |
commit | 83cf709a89fb97e78e60f310ea5f2b283e0f581c (patch) | |
tree | c5f8ecad62becd1645d2e54efcd4a00db60bf97a /fs/btrfs/extent-io-tree.h | |
parent | c45379a20fbcbbd166966711cf9481ecb41b8271 (diff) |
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.h | 5 |
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 */ |