提交 bf2681cb 编写于 作者: J Josef Bacik 提交者: 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: NJosef Bacik <jbacik@fb.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册