summaryrefslogtreecommitdiffstats
path: root/fs/btrfs/block-rsv.h
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/block-rsv.h')
-rw-r--r--fs/btrfs/block-rsv.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/fs/btrfs/block-rsv.h b/fs/btrfs/block-rsv.h
index feb0a4d4b1c9..d1428bb73fc5 100644
--- a/fs/btrfs/block-rsv.h
+++ b/fs/btrfs/block-rsv.h
@@ -3,6 +3,7 @@
#ifndef BTRFS_BLOCK_RSV_H
#define BTRFS_BLOCK_RSV_H
+struct btrfs_trans_handle;
enum btrfs_reserve_flush_enum;
/*
@@ -75,6 +76,12 @@ void btrfs_block_rsv_add_bytes(struct btrfs_block_rsv *block_rsv,
u64 __btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
struct btrfs_block_rsv *block_rsv,
u64 num_bytes, u64 *qgroup_to_release);
+void btrfs_update_global_block_rsv(struct btrfs_fs_info *fs_info);
+void btrfs_init_global_block_rsv(struct btrfs_fs_info *fs_info);
+void btrfs_release_global_block_rsv(struct btrfs_fs_info *fs_info);
+struct btrfs_block_rsv *btrfs_use_block_rsv(struct btrfs_trans_handle *trans,
+ struct btrfs_root *root,
+ u32 blocksize);
static inline void btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
struct btrfs_block_rsv *block_rsv,
@@ -83,4 +90,12 @@ static inline void btrfs_block_rsv_release(struct btrfs_fs_info *fs_info,
__btrfs_block_rsv_release(fs_info, block_rsv, num_bytes, NULL);
}
+static inline void btrfs_unuse_block_rsv(struct btrfs_fs_info *fs_info,
+ struct btrfs_block_rsv *block_rsv,
+ u32 blocksize)
+{
+ btrfs_block_rsv_add_bytes(block_rsv, blocksize, false);
+ btrfs_block_rsv_release(fs_info, block_rsv, 0);
+}
+
#endif /* BTRFS_BLOCK_RSV_H */