1 /* SPDX-License-Identifier: GPL-2.0 */
2 
3 #ifndef BTRFS_DELALLOC_SPACE_H
4 #define BTRFS_DELALLOC_SPACE_H
5 
6 struct extent_changeset;
7 
8 int btrfs_alloc_data_chunk_ondemand(struct btrfs_inode *inode, u64 bytes);
9 int btrfs_check_data_free_space(struct btrfs_inode *inode,
10 			struct extent_changeset **reserved, u64 start, u64 len,
11 			bool noflush);
12 void btrfs_free_reserved_data_space(struct btrfs_inode *inode,
13 			struct extent_changeset *reserved, u64 start, u64 len);
14 void btrfs_delalloc_release_space(struct btrfs_inode *inode,
15 				  struct extent_changeset *reserved,
16 				  u64 start, u64 len, bool qgroup_free);
17 void btrfs_free_reserved_data_space_noquota(struct btrfs_fs_info *fs_info,
18 					    u64 len);
19 void btrfs_delalloc_release_metadata(struct btrfs_inode *inode, u64 num_bytes,
20 				     bool qgroup_free);
21 int btrfs_delalloc_reserve_space(struct btrfs_inode *inode,
22 			struct extent_changeset **reserved, u64 start, u64 len);
23 int btrfs_delalloc_reserve_metadata(struct btrfs_inode *inode, u64 num_bytes,
24 				    u64 disk_num_bytes, bool noflush);
25 void btrfs_delalloc_release_extents(struct btrfs_inode *inode, u64 num_bytes);
26 
27 #endif /* BTRFS_DELALLOC_SPACE_H */
28