Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

btrfs: remove duplicated uuid tree existence check in btrfs_uuid_tree_add()

There's no point in checking if the uuid root exists in
btrfs_uuid_tree_add(), since we already do it in btrfs_uuid_tree_lookup().
We can just remove the check from btrfs_uuid_tree_add() and make
btrfs_uuid_tree_lookup() return -EINVAL instead of -ENOENT in case the
uuid tree does not exists.

Reviewed-by: Boris Burkov <boris@bur.io>
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>

authored by

Filipe Manana and committed by
David Sterba
01cebce7 7aa1788f

+1 -4
+1 -4
fs/btrfs/uuid-tree.c
··· 35 35 struct btrfs_key key; 36 36 37 37 if (WARN_ON_ONCE(!uuid_root)) 38 - return -ENOENT; 38 + return -EINVAL; 39 39 40 40 path = btrfs_alloc_path(); 41 41 if (!path) ··· 91 91 ret = btrfs_uuid_tree_lookup(uuid_root, uuid, type, subid_cpu); 92 92 if (ret != -ENOENT) 93 93 return ret; 94 - 95 - if (WARN_ON_ONCE(!uuid_root)) 96 - return -EINVAL; 97 94 98 95 btrfs_uuid_to_key(uuid, type, &key); 99 96