From 676f1f759fa3f65f8987295c99615c1090e074ea Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Thu, 20 Jun 2019 15:37:48 -0400 Subject: btrfs: export the block group caching helpers This will make it so we can move them easily. Signed-off-by: Josef Bacik Reviewed-by: David Sterba [ coding style updates ] Signed-off-by: David Sterba --- fs/btrfs/block-group.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'fs/btrfs/block-group.h') diff --git a/fs/btrfs/block-group.h b/fs/btrfs/block-group.h index 73147cce7952..7069bcfc5e8f 100644 --- a/fs/btrfs/block-group.h +++ b/fs/btrfs/block-group.h @@ -165,5 +165,18 @@ void btrfs_wait_block_group_reservations(struct btrfs_block_group_cache *bg); bool btrfs_inc_nocow_writers(struct btrfs_fs_info *fs_info, u64 bytenr); void btrfs_dec_nocow_writers(struct btrfs_fs_info *fs_info, u64 bytenr); void btrfs_wait_nocow_writers(struct btrfs_block_group_cache *bg); +void btrfs_wait_block_group_cache_progress(struct btrfs_block_group_cache *cache, + u64 num_bytes); +int btrfs_wait_block_group_cache_done(struct btrfs_block_group_cache *cache); +int btrfs_cache_block_group(struct btrfs_block_group_cache *cache, + int load_cache_only); + +static inline int btrfs_block_group_cache_done( + struct btrfs_block_group_cache *cache) +{ + smp_mb(); + return cache->cached == BTRFS_CACHE_FINISHED || + cache->cached == BTRFS_CACHE_ERROR; +} #endif /* BTRFS_BLOCK_GROUP_H */ -- cgit v1.2.3