]> www.infradead.org Git - users/willy/xarray.git/commitdiff
btrfs: pass NULL as trans to btrfs_search_slot if we only want to search
authorMarcos Paulo de Souza <mpdesouza@suse.com>
Tue, 20 Jul 2021 18:02:47 +0000 (15:02 -0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Aug 2021 11:19:00 +0000 (13:19 +0200)
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 <nborisov@suse.com>
Signed-off-by: Marcos Paulo de Souza <mpdesouza@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/backref.c
fs/btrfs/extent-tree.c

index 78b202d198b8e1741690a2a10fec1955cf221440..728c728d03f3c60ffc72bf40ddb867110db21bb9 100644 (file)
@@ -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);
index d5925bebd3792faeb2c53e5b3fcc3444df57ea20..fc3da7585fb786be71f0308541a4d21b4b96305f 100644 (file)
@@ -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;