Unverified Commit 03311e97 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11935 btrfs: remove NULL transaction support for btrfs_lookup_extent_info()

parents 84276fa7 4451e9ef
Loading
Loading
Loading
Loading
+2 −13
Original line number Diff line number Diff line
@@ -135,11 +135,6 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
	if (!path)
		return -ENOMEM;

	if (!trans) {
		path->skip_locking = 1;
		path->search_commit_root = 1;
	}

search_again:
	key.objectid = bytenr;
	key.offset = offset;
@@ -172,10 +167,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
		if (unlikely(item_size < sizeof(*ei))) {
			ret = -EINVAL;
			btrfs_print_v0_err(fs_info);
			if (trans)
			btrfs_abort_transaction(trans, ret);
			else
				btrfs_handle_fs_error(fs_info, ret, NULL);

			goto out_free;
		}
@@ -197,9 +189,6 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
		ret = 0;
	}

	if (!trans)
		goto out;

	delayed_refs = &trans->transaction->delayed_refs;
	spin_lock(&delayed_refs->lock);
	head = btrfs_find_delayed_ref_head(delayed_refs, bytenr);
@@ -239,7 +228,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
		mutex_unlock(&head->mutex);
	}
	spin_unlock(&delayed_refs->lock);
out:

	WARN_ON(num_refs == 0);
	if (refs)
		*refs = num_refs;