There's no need for an on stack key to define the root's key as we have
already defined the key in the root itself. So remove the stack variable
and use the key in the root.
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
struct extent_buffer *leaf;
struct btrfs_root *tree_root = fs_info->tree_root;
struct btrfs_root *root;
- struct btrfs_key key;
unsigned int nofs_flag;
int ret = 0;
btrfs_tree_unlock(leaf);
- key.objectid = objectid;
- key.type = BTRFS_ROOT_ITEM_KEY;
- key.offset = 0;
- ret = btrfs_insert_root(trans, tree_root, &key, &root->root_item);
+ ret = btrfs_insert_root(trans, tree_root, &root->root_key, &root->root_item);
if (ret)
goto fail;