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>
struct btrfs_key key;
if (WARN_ON_ONCE(!uuid_root))
- return -ENOENT;
+ return -EINVAL;
path = btrfs_alloc_path();
if (!path)
if (ret != -ENOENT)
return ret;
- if (WARN_ON_ONCE(!uuid_root))
- return -EINVAL;
-
btrfs_uuid_to_key(uuid, type, &key);
path = btrfs_alloc_path();