xref: /openbmc/linux/fs/btrfs/delalloc-space.h (revision 2839c2c1)
186736342SJosef Bacik /* SPDX-License-Identifier: GPL-2.0 */
286736342SJosef Bacik 
386736342SJosef Bacik #ifndef BTRFS_DELALLOC_SPACE_H
486736342SJosef Bacik #define BTRFS_DELALLOC_SPACE_H
586736342SJosef Bacik 
686736342SJosef Bacik struct extent_changeset;
786736342SJosef Bacik 
886736342SJosef Bacik int btrfs_alloc_data_chunk_ondemand(struct btrfs_inode *inode, u64 bytes);
936ea6f3eSNikolay Borisov int btrfs_check_data_free_space(struct btrfs_inode *inode,
101daedb1dSJosef Bacik 			struct extent_changeset **reserved, u64 start, u64 len,
111daedb1dSJosef Bacik 			bool noflush);
1225ce28caSNikolay Borisov void btrfs_free_reserved_data_space(struct btrfs_inode *inode,
1386736342SJosef Bacik 			struct extent_changeset *reserved, u64 start, u64 len);
1486d52921SNikolay Borisov void btrfs_delalloc_release_space(struct btrfs_inode *inode,
1586736342SJosef Bacik 				  struct extent_changeset *reserved,
1686736342SJosef Bacik 				  u64 start, u64 len, bool qgroup_free);
179db5d510SNikolay Borisov void btrfs_free_reserved_data_space_noquota(struct btrfs_fs_info *fs_info,
1886736342SJosef Bacik 					    u64 len);
1986736342SJosef Bacik void btrfs_delalloc_release_metadata(struct btrfs_inode *inode, u64 num_bytes,
2086736342SJosef Bacik 				     bool qgroup_free);
21e5b7231eSNikolay Borisov int btrfs_delalloc_reserve_space(struct btrfs_inode *inode,
2286736342SJosef Bacik 			struct extent_changeset **reserved, u64 start, u64 len);
23*2839c2c1SJosef Bacik int btrfs_delalloc_reserve_metadata(struct btrfs_inode *inode, u64 num_bytes,
24*2839c2c1SJosef Bacik 				    u64 disk_num_bytes, bool noflush);
25*2839c2c1SJosef Bacik void btrfs_delalloc_release_extents(struct btrfs_inode *inode, u64 num_bytes);
2686736342SJosef Bacik 
2786736342SJosef Bacik #endif /* BTRFS_DELALLOC_SPACE_H */
28