Commit bf2681cb authored by Josef Bacik's avatar Josef Bacik Committed by David Sterba

btrfs: add assertions for releasing trans handle reservations

These are useful for debugging problems where we mess with
trans->block_rsv to make sure we're not screwing something up.
Signed-off-by: default avatarJosef Bacik <jbacik@fb.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 3b60d436
...@@ -5823,12 +5823,15 @@ static void release_global_block_rsv(struct btrfs_fs_info *fs_info) ...@@ -5823,12 +5823,15 @@ static void release_global_block_rsv(struct btrfs_fs_info *fs_info)
void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans, void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans,
struct btrfs_fs_info *fs_info) struct btrfs_fs_info *fs_info)
{ {
if (!trans->block_rsv) if (!trans->block_rsv) {
ASSERT(!trans->bytes_reserved);
return; return;
}
if (!trans->bytes_reserved) if (!trans->bytes_reserved)
return; return;
ASSERT(trans->block_rsv == &fs_info->trans_block_rsv);
trace_btrfs_space_reservation(fs_info, "transaction", trace_btrfs_space_reservation(fs_info, "transaction",
trans->transid, trans->bytes_reserved, 0); trans->transid, trans->bytes_reserved, 0);
btrfs_block_rsv_release(fs_info, trans->block_rsv, btrfs_block_rsv_release(fs_info, trans->block_rsv,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment