struct btrfs_path *path)
 {
        struct btrfs_fs_info *fs_info = block_group->fs_info;
-       struct btrfs_root *root = fs_info->tree_root;
        struct inode *inode = NULL;
        struct extent_changeset *data_reserved = NULL;
        u64 alloc_hint = 0;
         * time.
         */
        BTRFS_I(inode)->generation = 0;
-       ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+       ret = btrfs_update_inode(trans, BTRFS_I(inode));
        if (ret) {
                /*
                 * So theoretically we could recover from this, simply set the
 
                                    struct page *page, size_t pg_offset,
                                    u64 start, u64 end);
 int btrfs_update_inode(struct btrfs_trans_handle *trans,
-                      struct btrfs_root *root, struct btrfs_inode *inode);
+                      struct btrfs_inode *inode);
 int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
                                struct btrfs_inode *inode);
 int btrfs_orphan_add(struct btrfs_trans_handle *trans, struct btrfs_inode *inode);
 
                if (!extent_info || extent_info->update_times)
                        inode->vfs_inode.i_mtime = inode_set_ctime_current(&inode->vfs_inode);
 
-               ret = btrfs_update_inode(trans, root, inode);
+               ret = btrfs_update_inode(trans, inode);
                if (ret)
                        break;
 
        ASSERT(trans != NULL);
        inode_inc_iversion(inode);
        inode->i_mtime = inode_set_ctime_current(inode);
-       ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+       ret = btrfs_update_inode(trans, BTRFS_I(inode));
        updated_inode = true;
        btrfs_end_transaction(trans);
        btrfs_btree_balance_dirty(fs_info);
                } else {
                        int ret2;
 
-                       ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+                       ret = btrfs_update_inode(trans, BTRFS_I(inode));
                        ret2 = btrfs_end_transaction(trans);
                        if (!ret)
                                ret = ret2;
        inode_set_ctime_current(inode);
        i_size_write(inode, end);
        btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0);
-       ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+       ret = btrfs_update_inode(trans, BTRFS_I(inode));
        ret2 = btrfs_end_transaction(trans);
 
        return ret ? ret : ret2;
 
        if (ret)
                goto fail;
 
-       ret = btrfs_update_inode(trans, root, inode);
+       ret = btrfs_update_inode(trans, inode);
 
 fail:
        if (locked)
          "failed to write free space cache for block group %llu error %d",
                                  block_group->start, ret);
        }
-       btrfs_update_inode(trans, root, BTRFS_I(inode));
+       btrfs_update_inode(trans, BTRFS_I(inode));
 
        if (block_group) {
                /* the dirty list is protected by the dirty_bgs_lock */
 /*
  * Write out cached info to an inode.
  *
- * @root:        root the inode belongs to
  * @inode:       freespace inode we are writing out
  * @ctl:         free space cache we are going to write out
  * @block_group: block_group for this cache if it belongs to a block_group
  * on mount.  This will return 0 if it was successful in writing the cache out,
  * or an errno if it was not.
  */
-static int __btrfs_write_out_cache(struct btrfs_root *root, struct inode *inode,
+static int __btrfs_write_out_cache(struct inode *inode,
                                   struct btrfs_free_space_ctl *ctl,
                                   struct btrfs_block_group *block_group,
                                   struct btrfs_io_ctl *io_ctl,
                invalidate_inode_pages2(inode->i_mapping);
                BTRFS_I(inode)->generation = 0;
        }
-       btrfs_update_inode(trans, root, BTRFS_I(inode));
+       btrfs_update_inode(trans, BTRFS_I(inode));
        if (must_iput)
                iput(inode);
        return ret;
        if (IS_ERR(inode))
                return 0;
 
-       ret = __btrfs_write_out_cache(fs_info->tree_root, inode, ctl,
-                               block_group, &block_group->io_ctl, trans);
+       ret = __btrfs_write_out_cache(inode, ctl, block_group,
+                                     &block_group->io_ctl, trans);
        if (ret) {
                btrfs_debug(fs_info,
          "failed to write free space cache for block group %llu error %d",
 
        }
 
        btrfs_update_inode_bytes(inode, size, drop_args.bytes_found);
-       ret = btrfs_update_inode(trans, root, inode);
+       ret = btrfs_update_inode(trans, inode);
        if (ret && ret != -ENOSPC) {
                btrfs_abort_transaction(trans, ret);
                goto out;
  * copy everything in the in-memory inode into the btree.
  */
 int btrfs_update_inode(struct btrfs_trans_handle *trans,
-                      struct btrfs_root *root,
                       struct btrfs_inode *inode)
 {
+       struct btrfs_root *root = inode->root;
        struct btrfs_fs_info *fs_info = root->fs_info;
        int ret;
 
 {
        int ret;
 
-       ret = btrfs_update_inode(trans, inode->root, inode);
+       ret = btrfs_update_inode(trans, inode);
        if (ret == -ENOSPC)
                return btrfs_update_inode_item(trans, inode->root, inode);
        return ret;
        inode_inc_iversion(&dir->vfs_inode);
        inode_set_ctime_current(&inode->vfs_inode);
        dir->vfs_inode.i_mtime = inode_set_ctime_current(&dir->vfs_inode);
-       ret = btrfs_update_inode(trans, root, dir);
+       ret = btrfs_update_inode(trans, dir);
 out:
        return ret;
 }
        ret = __btrfs_unlink_inode(trans, dir, inode, name, NULL);
        if (!ret) {
                drop_nlink(&inode->vfs_inode);
-               ret = btrfs_update_inode(trans, inode->root, inode);
+               ret = btrfs_update_inode(trans, inode);
        }
        return ret;
 }
                btrfs_abort_transaction(trans, ret);
        } else {
                btrfs_update_inode_bytes(inode, 0, drop_args.bytes_found);
-               btrfs_update_inode(trans, root, inode);
+               btrfs_update_inode(trans, inode);
        }
        btrfs_end_transaction(trans);
        return ret;
                i_size_write(inode, newsize);
                btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0);
                pagecache_isize_extended(inode, oldsize, newsize);
-               ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+               ret = btrfs_update_inode(trans, BTRFS_I(inode));
                btrfs_drew_write_unlock(&root->snapshot_lock);
                btrfs_end_transaction(trans);
        } else {
        if (IS_ERR(trans))
                return PTR_ERR(trans);
 
-       ret = btrfs_update_inode(trans, root, inode);
+       ret = btrfs_update_inode(trans, inode);
        if (ret == -ENOSPC || ret == -EDQUOT) {
                /* whoops, lets try again with the full transaction */
                btrfs_end_transaction(trans);
                if (IS_ERR(trans))
                        return PTR_ERR(trans);
 
-               ret = btrfs_update_inode(trans, root, inode);
+               ret = btrfs_update_inode(trans, inode);
        }
        btrfs_end_transaction(trans);
        if (inode->delayed_node)
                parent_inode->vfs_inode.i_mtime =
                        inode_set_ctime_current(&parent_inode->vfs_inode);
 
-       ret = btrfs_update_inode(trans, root, parent_inode);
+       ret = btrfs_update_inode(trans, parent_inode);
        if (ret)
                btrfs_abort_transaction(trans, ret);
        return ret;
        } else {
                struct dentry *parent = dentry->d_parent;
 
-               err = btrfs_update_inode(trans, root, BTRFS_I(inode));
+               err = btrfs_update_inode(trans, BTRFS_I(inode));
                if (err)
                        goto fail;
                if (inode->i_nlink == 1) {
                if (ret != -ENOSPC && ret != -EAGAIN)
                        break;
 
-               ret = btrfs_update_inode(trans, root, inode);
+               ret = btrfs_update_inode(trans, inode);
                if (ret)
                        break;
 
                int ret2;
 
                trans->block_rsv = &fs_info->trans_block_rsv;
-               ret2 = btrfs_update_inode(trans, root, inode);
+               ret2 = btrfs_update_inode(trans, inode);
                if (ret2 && !ret)
                        ret = ret2;
 
                                           BTRFS_I(old_dentry->d_inode),
                                           old_name, &old_rename_ctx);
                if (!ret)
-                       ret = btrfs_update_inode(trans, root, BTRFS_I(old_inode));
+                       ret = btrfs_update_inode(trans, BTRFS_I(old_inode));
        }
        if (ret) {
                btrfs_abort_transaction(trans, ret);
                                           BTRFS_I(new_dentry->d_inode),
                                           new_name, &new_rename_ctx);
                if (!ret)
-                       ret = btrfs_update_inode(trans, dest, BTRFS_I(new_inode));
+                       ret = btrfs_update_inode(trans, BTRFS_I(new_inode));
        }
        if (ret) {
                btrfs_abort_transaction(trans, ret);
                                           BTRFS_I(d_inode(old_dentry)),
                                           &old_fname.disk_name, &rename_ctx);
                if (!ret)
-                       ret = btrfs_update_inode(trans, root, BTRFS_I(old_inode));
+                       ret = btrfs_update_inode(trans, BTRFS_I(old_inode));
        }
        if (ret) {
                btrfs_abort_transaction(trans, ret);
                        btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0);
                }
 
-               ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+               ret = btrfs_update_inode(trans, BTRFS_I(inode));
 
                if (ret) {
                        btrfs_abort_transaction(trans, ret);
 
        btrfs_sync_inode_flags_to_i_flags(inode);
        inode_inc_iversion(inode);
        inode_set_ctime_current(inode);
-       ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+       ret = btrfs_update_inode(trans, BTRFS_I(inode));
 
  out_end_trans:
        btrfs_end_transaction(trans);
 
                                     const u64 olen,
                                     int no_time_update)
 {
-       struct btrfs_root *root = BTRFS_I(inode)->root;
        int ret;
 
        inode_inc_iversion(inode);
                btrfs_inode_safe_disk_i_size_write(BTRFS_I(inode), 0);
        }
 
-       ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+       ret = btrfs_update_inode(trans, BTRFS_I(inode));
        if (ret) {
                btrfs_abort_transaction(trans, ret);
                btrfs_end_transaction(trans);
 
 
 update_inode:
        btrfs_update_inode_bytes(BTRFS_I(inode), nbytes, drop_args.bytes_found);
-       ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+       ret = btrfs_update_inode(trans, BTRFS_I(inode));
 out:
        iput(inode);
        return ret;
                        if (ret)
                                goto out;
 
-                       ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+                       ret = btrfs_update_inode(trans, BTRFS_I(inode));
                        if (ret)
                                goto out;
                }
 
        if (nlink != inode->i_nlink) {
                set_nlink(inode, nlink);
-               ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+               ret = btrfs_update_inode(trans, BTRFS_I(inode));
                if (ret)
                        goto out;
        }
                        set_nlink(inode, 1);
                else
                        inc_nlink(inode);
-               ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+               ret = btrfs_update_inode(trans, BTRFS_I(inode));
        } else if (ret == -EEXIST) {
                ret = 0;
        }
 out:
        if (!ret && update_size) {
                btrfs_i_size_write(BTRFS_I(dir), dir->i_size + name.len * 2);
-               ret = btrfs_update_inode(trans, root, BTRFS_I(dir));
+               ret = btrfs_update_inode(trans, BTRFS_I(dir));
        }
        kfree(name.name);
        iput(dir);
                                                        drop_args.bytes_found);
                                        /* Update the inode's nbytes. */
                                        ret = btrfs_update_inode(wc->trans,
-                                                       root, BTRFS_I(inode));
+                                                                BTRFS_I(inode));
                                }
                                iput(inode);
                                if (ret)
 
        }
        inode->ro_flags &= ~BTRFS_INODE_RO_VERITY;
        btrfs_sync_inode_flags_to_i_flags(&inode->vfs_inode);
-       ret = btrfs_update_inode(trans, root, inode);
+       ret = btrfs_update_inode(trans, inode);
        if (ret) {
                btrfs_abort_transaction(trans, ret);
                goto out;
        }
        inode->ro_flags |= BTRFS_INODE_RO_VERITY;
        btrfs_sync_inode_flags_to_i_flags(&inode->vfs_inode);
-       ret = btrfs_update_inode(trans, root, inode);
+       ret = btrfs_update_inode(trans, inode);
        if (ret)
                goto end_trans;
        ret = del_orphan(trans, inode);
 
 
        inode_inc_iversion(inode);
        inode_set_ctime_current(inode);
-       ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+       ret = btrfs_update_inode(trans, BTRFS_I(inode));
        if (ret)
                btrfs_abort_transaction(trans, ret);
 out:
        if (!ret) {
                inode_inc_iversion(inode);
                inode_set_ctime_current(inode);
-               ret = btrfs_update_inode(trans, root, BTRFS_I(inode));
+               ret = btrfs_update_inode(trans, BTRFS_I(inode));
                if (ret)
                        btrfs_abort_transaction(trans, ret);
        }