aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/free-space-cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/free-space-cache.h')
-rw-r--r--fs/btrfs/free-space-cache.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/fs/btrfs/free-space-cache.h b/fs/btrfs/free-space-cache.h
index a64a23fae1eb..af06e6b6ceaa 100644
--- a/fs/btrfs/free-space-cache.h
+++ b/fs/btrfs/free-space-cache.h
@@ -64,15 +64,25 @@ int btrfs_write_out_cache(struct btrfs_root *root,
64 struct btrfs_trans_handle *trans, 64 struct btrfs_trans_handle *trans,
65 struct btrfs_block_group_cache *block_group, 65 struct btrfs_block_group_cache *block_group,
66 struct btrfs_path *path); 66 struct btrfs_path *path);
67
67void btrfs_init_free_space_ctl(struct btrfs_block_group_cache *block_group); 68void btrfs_init_free_space_ctl(struct btrfs_block_group_cache *block_group);
68int btrfs_add_free_space(struct btrfs_block_group_cache *block_group, 69int __btrfs_add_free_space(struct btrfs_free_space_ctl *ctl,
69 u64 bytenr, u64 size); 70 u64 bytenr, u64 size);
71static inline int
72btrfs_add_free_space(struct btrfs_block_group_cache *block_group,
73 u64 bytenr, u64 size)
74{
75 return __btrfs_add_free_space(block_group->free_space_ctl,
76 bytenr, size);
77}
70int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group, 78int btrfs_remove_free_space(struct btrfs_block_group_cache *block_group,
71 u64 bytenr, u64 size); 79 u64 bytenr, u64 size);
80void __btrfs_remove_free_space_cache(struct btrfs_free_space_ctl *ctl);
72void btrfs_remove_free_space_cache(struct btrfs_block_group_cache 81void btrfs_remove_free_space_cache(struct btrfs_block_group_cache
73 *block_group); 82 *block_group);
74u64 btrfs_find_space_for_alloc(struct btrfs_block_group_cache *block_group, 83u64 btrfs_find_space_for_alloc(struct btrfs_block_group_cache *block_group,
75 u64 offset, u64 bytes, u64 empty_size); 84 u64 offset, u64 bytes, u64 empty_size);
85u64 btrfs_find_ino_for_alloc(struct btrfs_root *fs_root);
76void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group, 86void btrfs_dump_free_space(struct btrfs_block_group_cache *block_group,
77 u64 bytes); 87 u64 bytes);
78int btrfs_find_space_cluster(struct btrfs_trans_handle *trans, 88int btrfs_find_space_cluster(struct btrfs_trans_handle *trans,