diff options
author | Josef Bacik <josef@toxicpanda.com> | 2019-06-19 19:47:23 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2019-07-02 12:30:55 +0200 |
commit | 67f9c2209e885c8f97215655739155c94ca9cb9c (patch) | |
tree | db366b452a1f98471c1a44962820f31285e48d1c /fs/btrfs/block-rsv.h | |
parent | btrfs: migrate the block-rsv code to block-rsv.c (diff) | |
download | linux-67f9c2209e885c8f97215655739155c94ca9cb9c.tar.xz linux-67f9c2209e885c8f97215655739155c94ca9cb9c.zip |
btrfs: migrate the global_block_rsv helpers to block-rsv.c
These helpers belong in block-rsv.c
Signed-off-by: Josef Bacik <josef@toxicpanda.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/block-rsv.h')
-rw-r--r-- | fs/btrfs/block-rsv.h | 15 |
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 */ |