return ret;
 }
 
-int extent_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo,
+int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo,
                  u64 start, u64 len)
 {
        int ret = 0;
        u64 last;
        u64 last_for_get_extent = 0;
        u64 disko = 0;
-       u64 isize = i_size_read(inode);
+       u64 isize = i_size_read(&inode->vfs_inode);
        struct btrfs_key found_key;
        struct extent_map *em = NULL;
        struct extent_state *cached_state = NULL;
        struct btrfs_path *path;
-       struct btrfs_root *root = BTRFS_I(inode)->root;
+       struct btrfs_root *root = inode->root;
        struct fiemap_cache cache = { 0 };
        struct ulist *roots;
        struct ulist *tmp_ulist;
                goto out_free_ulist;
        }
 
-       start = round_down(start, btrfs_inode_sectorsize(BTRFS_I(inode)));
-       len = round_up(max, btrfs_inode_sectorsize(BTRFS_I(inode))) - start;
+       start = round_down(start, btrfs_inode_sectorsize(inode));
+       len = round_up(max, btrfs_inode_sectorsize(inode)) - start;
 
        /*
         * lookup the last file extent.  We're not using i_size here
         * because there might be preallocation past i_size
         */
-       ret = btrfs_lookup_file_extent(NULL, root, path,
-                       btrfs_ino(BTRFS_I(inode)), -1, 0);
+       ret = btrfs_lookup_file_extent(NULL, root, path, btrfs_ino(inode), -1,
+                                      0);
        if (ret < 0) {
                goto out_free_ulist;
        } else {
        found_type = found_key.type;
 
        /* No extents, but there might be delalloc bits */
-       if (found_key.objectid != btrfs_ino(BTRFS_I(inode)) ||
+       if (found_key.objectid != btrfs_ino(inode) ||
            found_type != BTRFS_EXTENT_DATA_KEY) {
                /* have to trust i_size as the end */
                last = (u64)-1;
                last_for_get_extent = isize;
        }
 
-       lock_extent_bits(&BTRFS_I(inode)->io_tree, start, start + len - 1,
+       lock_extent_bits(&inode->io_tree, start, start + len - 1,
                         &cached_state);
 
-       em = get_extent_skip_holes(BTRFS_I(inode), start, last_for_get_extent);
+       em = get_extent_skip_holes(inode, start, last_for_get_extent);
        if (!em)
                goto out;
        if (IS_ERR(em)) {
                         * then we're just getting a count and we can skip the
                         * lookup stuff.
                         */
-                       ret = btrfs_check_shared(root,
-                                                btrfs_ino(BTRFS_I(inode)),
+                       ret = btrfs_check_shared(root, btrfs_ino(inode),
                                                 bytenr, roots, tmp_ulist);
                        if (ret < 0)
                                goto out_free;
                }
 
                /* now scan forward to see if this is really the last extent. */
-               em = get_extent_skip_holes(BTRFS_I(inode), off,
-                                          last_for_get_extent);
+               em = get_extent_skip_holes(inode, off, last_for_get_extent);
                if (IS_ERR(em)) {
                        ret = PTR_ERR(em);
                        goto out;
                ret = emit_last_fiemap_cache(fieinfo, &cache);
        free_extent_map(em);
 out:
-       unlock_extent_cached(&BTRFS_I(inode)->io_tree, start, start + len - 1,
+       unlock_extent_cached(&inode->io_tree, start, start + len - 1,
                             &cached_state);
 
 out_free_ulist: