struct inode vfs_inode;
 };
 
+static inline u32 btrfs_inode_sectorsize(const struct btrfs_inode *inode)
+{
+       return inode->root->fs_info->sectorsize;
+}
+
 static inline struct btrfs_inode *BTRFS_I(const struct inode *inode)
 {
        return container_of(inode, struct btrfs_inode, vfs_inode);
 
        void *filldir_buf;
 };
 
-static inline u32 btrfs_inode_sectorsize(const struct inode *inode)
-{
-       return btrfs_sb(inode->i_sb)->sectorsize;
-}
 
 static inline u32 BTRFS_LEAF_DATA_SIZE(const struct btrfs_fs_info *info)
 {
 
 static struct extent_map *get_extent_skip_holes(struct inode *inode,
                                                u64 offset, u64 last)
 {
-       u64 sectorsize = btrfs_inode_sectorsize(inode);
+       u64 sectorsize = btrfs_inode_sectorsize(BTRFS_I(inode));
        struct extent_map *em;
        u64 len;
 
                goto out_free_ulist;
        }
 
-       start = round_down(start, btrfs_inode_sectorsize(inode));
-       len = round_up(max, btrfs_inode_sectorsize(inode)) - start;
+       start = round_down(start, btrfs_inode_sectorsize(BTRFS_I(inode)));
+       len = round_up(max, btrfs_inode_sectorsize(BTRFS_I(inode))) - start;
 
        /*
         * lookup the last file extent.  We're not using i_size here
 
                goto out_only_mutex;
        }
 
-       lockstart = round_up(offset, btrfs_inode_sectorsize(inode));
+       lockstart = round_up(offset, btrfs_inode_sectorsize(BTRFS_I(inode)));
        lockend = round_down(offset + len,
-                            btrfs_inode_sectorsize(inode)) - 1;
+                            btrfs_inode_sectorsize(BTRFS_I(inode))) - 1;
        same_block = (BTRFS_BYTES_TO_BLKS(fs_info, offset))
                == (BTRFS_BYTES_TO_BLKS(fs_info, offset + len - 1));
        /*
 static int btrfs_zero_range_check_range_boundary(struct inode *inode,
                                                 u64 offset)
 {
-       const u64 sectorsize = btrfs_inode_sectorsize(inode);
+       const u64 sectorsize = btrfs_inode_sectorsize(BTRFS_I(inode));
        struct extent_map *em;
        int ret;
 
        struct extent_changeset *data_reserved = NULL;
        int ret;
        u64 alloc_hint = 0;
-       const u64 sectorsize = btrfs_inode_sectorsize(inode);
+       const u64 sectorsize = btrfs_inode_sectorsize(BTRFS_I(inode));
        u64 alloc_start = round_down(offset, sectorsize);
        u64 alloc_end = round_up(offset + len, sectorsize);
        u64 bytes_to_reserve = 0;
        u64 locked_end;
        u64 actual_end = 0;
        struct extent_map *em;
-       int blocksize = btrfs_inode_sectorsize(inode);
+       int blocksize = btrfs_inode_sectorsize(BTRFS_I(inode));
        int ret;
 
        alloc_start = round_down(offset, blocksize);
 
        struct btrfs_ordered_inode_tree *tree = &BTRFS_I(inode)->ordered_tree;
        unsigned long num_sectors;
        unsigned long i;
-       u32 sectorsize = btrfs_inode_sectorsize(inode);
+       u32 sectorsize = btrfs_inode_sectorsize(BTRFS_I(inode));
        const u16 csum_size = btrfs_super_csum_size(fs_info->super_copy);
        int index = 0;
 
 
                               const u64 datal,
                               const u8 comp_type)
 {
-       const u64 block_size = btrfs_inode_sectorsize(inode);
+       const u64 block_size = btrfs_inode_sectorsize(BTRFS_I(inode));
        const u64 range_end = file_offset + block_size - 1;
        const size_t inline_size = size - btrfs_file_extent_calc_inline_size(0);
        char *data_start = inline_data + btrfs_file_extent_calc_inline_size(0);