提交 7c777430 编写于 作者: J Josef Bacik 提交者: David Sterba

Btrfs: only check delayed ref usage in should_end_transaction

We were only doing btrfs_check_space_for_delayed_refs() if the metadata
space was full, ie we couldn't allocate chunks.  This assumes we'll be
able to allocate chunks during transaction commit, but since nothing
does a LIMIT flush during the transaction commit this won't actually
happen unless we happen to run shy of actual space.  We already take
into account a full fs in btrfs_check_space_for_delayed_refs() so just
kill this extra check to make sure we're ending the transaction when we
need to.
Signed-off-by: NJosef Bacik <jbacik@fb.com>
Reviewed-by: NDavid Sterba <dsterba@suse.com>
Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 fd708b81
...@@ -797,8 +797,7 @@ static int should_end_transaction(struct btrfs_trans_handle *trans) ...@@ -797,8 +797,7 @@ static int should_end_transaction(struct btrfs_trans_handle *trans)
{ {
struct btrfs_fs_info *fs_info = trans->fs_info; struct btrfs_fs_info *fs_info = trans->fs_info;
if (fs_info->global_block_rsv.space_info->full && if (btrfs_check_space_for_delayed_refs(trans, fs_info))
btrfs_check_space_for_delayed_refs(trans, fs_info))
return 1; return 1;
return !!btrfs_block_rsv_check(&fs_info->global_block_rsv, 5); return !!btrfs_block_rsv_check(&fs_info->global_block_rsv, 5);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册