From: Marcos Paulo de Souza Date: Tue, 20 Jul 2021 18:02:47 +0000 (-0300) Subject: btrfs: pass NULL as trans to btrfs_search_slot if we only want to search X-Git-Tag: accepted/tizen/unified/20230118.172025~6109^2~122 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6534c0c99dddafc47bd4152949751ccd6a5681fc;p=platform%2Fkernel%2Flinux-rpi.git 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: Nikolay Borisov Signed-off-by: Marcos Paulo de Souza Signed-off-by: David Sterba --- diff --git a/fs/btrfs/backref.c b/fs/btrfs/backref.c index 78b202d..728c728 100644 --- a/fs/btrfs/backref.c +++ b/fs/btrfs/backref.c @@ -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); diff --git a/fs/btrfs/extent-tree.c b/fs/btrfs/extent-tree.c index d5925be..fc3da75 100644 --- a/fs/btrfs/extent-tree.c +++ b/fs/btrfs/extent-tree.c @@ -153,7 +153,7 @@ search_again: 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;