Commit 6534c0c9 authored by Marcos Paulo de Souza's avatar Marcos Paulo de Souza Committed by David Sterba
Browse files

btrfs: pass NULL as trans to btrfs_search_slot if we only want to search



Using a transaction in btrfs_search_slot is only useful when we are
searching to add or modify the tree. When the function is used for
searching, insert length and mod arguments are 0, there is no need to
use a transaction.

No functional changes, changing for consistency.

Reviewed-by: default avatarNikolay Borisov <nborisov@suse.com>
Signed-off-by: default avatarMarcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 069a2e37
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1211,7 +1211,7 @@ static int find_parent_nodes(struct btrfs_trans_handle *trans,
again:
	head = NULL;

	ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 0);
	ret = btrfs_search_slot(NULL, fs_info->extent_root, &key, path, 0, 0);
	if (ret < 0)
		goto out;
	BUG_ON(ret == 0);
+1 −1
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ int btrfs_lookup_extent_info(struct btrfs_trans_handle *trans,
	else
		key.type = BTRFS_EXTENT_ITEM_KEY;

	ret = btrfs_search_slot(trans, fs_info->extent_root, &key, path, 0, 0);
	ret = btrfs_search_slot(NULL, fs_info->extent_root, &key, path, 0, 0);
	if (ret < 0)
		goto out_free;