summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/block-group.h
diff options
context:
space:
mode:
authorJosef Bacik <josef@toxicpanda.com>2019-06-20 15:37:48 -0400
committerDavid Sterba <dsterba@suse.com>2019-09-09 14:59:04 +0200
commit676f1f759fa3f65f8987295c99615c1090e074ea (patch)
treec72e47dc48b58576df6a80bcb77a1b926622bd0c /fs/btrfs/block-group.h
parent3eeb3226a8891544ea4a9baf27ba3d73e8a42991 (diff)
btrfs: export the block group caching helpers
This will make it so we can move them easily. Signed-off-by: Josef Bacik <josef@toxicpanda.com> Reviewed-by: David Sterba <dsterba@suse.com> [ coding style updates ] Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/block-group.h')
-rw-r--r--fs/btrfs/block-group.h13
1 files changed, 13 insertions, 0 deletions
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 */