diff mbox

[37/38] btrfs: Make get_extent_t take btrfs_inode

Message ID 1487342609-20652-38-git-send-email-nborisov@suse.com (mailing list archive)
State Accepted
Headers show

Commit Message

Nikolay Borisov Feb. 17, 2017, 2:43 p.m. UTC
In addition to changing the signature, this patch also switches
all the functions which are used as an argument to also take btrfs_inode.
Namely those are: btrfs_get_extent and btrfs_get_extent_filemap.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 fs/btrfs/ctree.h     |  4 ++--
 fs/btrfs/disk-io.c   |  6 +++---
 fs/btrfs/extent_io.c |  6 +++---
 fs/btrfs/extent_io.h |  2 +-
 fs/btrfs/file.c      |  6 +++---
 fs/btrfs/inode.c     | 24 ++++++++++++------------
 fs/btrfs/ioctl.c     |  2 +-
 7 files changed, 25 insertions(+), 25 deletions(-)

Comments

kernel test robot Feb. 17, 2017, 5:14 p.m. UTC | #1
Hi Nikolay,

[auto build test ERROR on next-20170217]
[cannot apply to btrfs/next v4.9-rc8 v4.9-rc7 v4.9-rc6 v4.10-rc8]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Nikolay-Borisov/More-btrfs_inode-cleanups/20170217-233314
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gnu-gcc (Debian 6.1.1-9) 6.1.1 20160705
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=sparc64 

All errors (new ones prefixed by >>):

   fs/btrfs/tests/inode-tests.c: In function 'test_btrfs_get_extent':
>> fs/btrfs/tests/inode-tests.c:281:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, 0, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:296:26: error: passing argument 1 of 'btrfs_drop_extent_cache' from incompatible pointer type [-Werror=incompatible-pointer-types]
     btrfs_drop_extent_cache(inode, 0, (u64)-1, 0);
                             ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3222:6: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    void btrfs_drop_extent_cache(struct btrfs_inode *inode, u64 start, u64 end,
         ^~~~~~~~~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:305:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, 0, (u64)-1, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:326:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:353:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:375:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:402:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:431:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:453:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:487:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:516:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:546:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:579:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:614:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^~~~~~~~~~~~~~~~
   fs/btrfs/tests/inode-tests.c:648:24: error: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type [-Werror=incompatible-pointer-types]
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
                           ^~~~~

vim +/btrfs_get_extent +281 fs/btrfs/tests/inode-tests.c

aaedb55b Josef Bacik 2013-10-11  275  	btrfs_set_header_nritems(root->node, 0);
aaedb55b Josef Bacik 2013-10-11  276  	btrfs_set_header_level(root->node, 0);
aaedb55b Josef Bacik 2013-10-11  277  	ret = -EINVAL;
aaedb55b Josef Bacik 2013-10-11  278  
aaedb55b Josef Bacik 2013-10-11  279  	/* First with no extents */
aaedb55b Josef Bacik 2013-10-11  280  	BTRFS_I(inode)->root = root;
b9ef22de Feifei Xu   2016-06-01 @281  	em = btrfs_get_extent(inode, NULL, 0, 0, sectorsize, 0);
aaedb55b Josef Bacik 2013-10-11  282  	if (IS_ERR(em)) {
aaedb55b Josef Bacik 2013-10-11  283  		em = NULL;
aaedb55b Josef Bacik 2013-10-11  284  		test_msg("Got an error when we shouldn't have\n");

:::::: The code at line 281 was first introduced by commit
:::::: b9ef22dedde08ab1b4ccd5f53344984c4dcb89f4 Btrfs: self-tests: Support non-4k page size

:::::: TO: Feifei Xu <xufeifei@linux.vnet.ibm.com>
:::::: CC: David Sterba <dsterba@suse.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
kernel test robot Feb. 17, 2017, 5:26 p.m. UTC | #2
Hi Nikolay,

[auto build test WARNING on next-20170217]
[cannot apply to btrfs/next v4.9-rc8 v4.9-rc7 v4.9-rc6 v4.10-rc8]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Nikolay-Borisov/More-btrfs_inode-cleanups/20170217-233314
config: xtensa-allmodconfig (attached as .config)
compiler: xtensa-linux-gcc (GCC) 4.9.0
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=xtensa 

All warnings (new ones prefixed by >>):

   fs/btrfs/tests/inode-tests.c: In function 'test_btrfs_get_extent':
>> fs/btrfs/tests/inode-tests.c:281:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, 0, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:296:2: warning: passing argument 1 of 'btrfs_drop_extent_cache' from incompatible pointer type
     btrfs_drop_extent_cache(inode, 0, (u64)-1, 0);
     ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3222:6: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    void btrfs_drop_extent_cache(struct btrfs_inode *inode, u64 start, u64 end,
         ^
   fs/btrfs/tests/inode-tests.c:305:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, 0, (u64)-1, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:326:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:353:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:375:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:402:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:431:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:453:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:487:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:516:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:546:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:579:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:614:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^
   In file included from fs/btrfs/tests/inode-tests.c:21:0:
   fs/btrfs/tests/../ctree.h:3169:20: note: expected 'struct btrfs_inode *' but argument is of type 'struct inode *'
    struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
                       ^
   fs/btrfs/tests/inode-tests.c:648:7: warning: passing argument 1 of 'btrfs_get_extent' from incompatible pointer type
     em = btrfs_get_extent(inode, NULL, 0, offset, sectorsize, 0);
          ^

vim +/btrfs_get_extent +281 fs/btrfs/tests/inode-tests.c

aaedb55b Josef Bacik        2013-10-11  265  	if (!root->node) {
aaedb55b Josef Bacik        2013-10-11  266  		test_msg("Couldn't allocate dummy buffer\n");
aaedb55b Josef Bacik        2013-10-11  267  		goto out;
aaedb55b Josef Bacik        2013-10-11  268  	}
aaedb55b Josef Bacik        2013-10-11  269  
aaedb55b Josef Bacik        2013-10-11  270  	/*
aaedb55b Josef Bacik        2013-10-11  271  	 * We will just free a dummy node if it's ref count is 2 so we need an
01327610 Nicholas D Steeves 2016-05-19  272  	 * extra ref so our searches don't accidentally release our page.
aaedb55b Josef Bacik        2013-10-11  273  	 */
aaedb55b Josef Bacik        2013-10-11  274  	extent_buffer_get(root->node);
aaedb55b Josef Bacik        2013-10-11  275  	btrfs_set_header_nritems(root->node, 0);
aaedb55b Josef Bacik        2013-10-11  276  	btrfs_set_header_level(root->node, 0);
aaedb55b Josef Bacik        2013-10-11  277  	ret = -EINVAL;
aaedb55b Josef Bacik        2013-10-11  278  
aaedb55b Josef Bacik        2013-10-11  279  	/* First with no extents */
aaedb55b Josef Bacik        2013-10-11  280  	BTRFS_I(inode)->root = root;
b9ef22de Feifei Xu          2016-06-01 @281  	em = btrfs_get_extent(inode, NULL, 0, 0, sectorsize, 0);
aaedb55b Josef Bacik        2013-10-11  282  	if (IS_ERR(em)) {
aaedb55b Josef Bacik        2013-10-11  283  		em = NULL;
aaedb55b Josef Bacik        2013-10-11  284  		test_msg("Got an error when we shouldn't have\n");
aaedb55b Josef Bacik        2013-10-11  285  		goto out;
aaedb55b Josef Bacik        2013-10-11  286  	}
aaedb55b Josef Bacik        2013-10-11  287  	if (em->block_start != EXTENT_MAP_HOLE) {
aaedb55b Josef Bacik        2013-10-11  288  		test_msg("Expected a hole, got %llu\n", em->block_start);
aaedb55b Josef Bacik        2013-10-11  289  		goto out;

:::::: The code at line 281 was first introduced by commit
:::::: b9ef22dedde08ab1b4ccd5f53344984c4dcb89f4 Btrfs: self-tests: Support non-4k page size

:::::: TO: Feifei Xu <xufeifei@linux.vnet.ibm.com>
:::::: CC: David Sterba <dsterba@suse.com>

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
diff mbox

Patch

diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
index d44d414a2127..7ac0338379b4 100644
--- a/fs/btrfs/ctree.h
+++ b/fs/btrfs/ctree.h
@@ -3100,7 +3100,7 @@  struct btrfs_delalloc_work *btrfs_alloc_delalloc_work(struct inode *inode,
 						    int delay_iput);
 void btrfs_wait_and_free_delalloc_work(struct btrfs_delalloc_work *work);
 
-struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *page,
+struct extent_map *btrfs_get_extent_fiemap(struct btrfs_inode *inode, struct page *page,
 					   size_t pg_offset, u64 start, u64 len,
 					   int create);
 noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len,
@@ -3166,7 +3166,7 @@  void btrfs_destroy_cachep(void);
 long btrfs_ioctl_trans_end(struct file *file);
 struct inode *btrfs_iget(struct super_block *s, struct btrfs_key *location,
 			 struct btrfs_root *root, int *was_new);
-struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
+struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
 				    size_t pg_offset, u64 start, u64 end,
 				    int create);
 int btrfs_update_inode(struct btrfs_trans_handle *trans,
diff --git a/fs/btrfs/disk-io.c b/fs/btrfs/disk-io.c
index 32a9ec11888d..3c0dd67333ee 100644
--- a/fs/btrfs/disk-io.c
+++ b/fs/btrfs/disk-io.c
@@ -219,12 +219,12 @@  void btrfs_set_buffer_lockdep_class(u64 objectid, struct extent_buffer *eb,
  * extents on the btree inode are pretty simple, there's one extent
  * that covers the entire device
  */
-static struct extent_map *btree_get_extent(struct inode *inode,
+static struct extent_map *btree_get_extent(struct btrfs_inode *inode,
 		struct page *page, size_t pg_offset, u64 start, u64 len,
 		int create)
 {
-	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
-	struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
+	struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb);
+	struct extent_map_tree *em_tree = &inode->extent_tree;
 	struct extent_map *em;
 	int ret;
 
diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c
index fad5b2030c37..887d8a896ce1 100644
--- a/fs/btrfs/extent_io.c
+++ b/fs/btrfs/extent_io.c
@@ -2857,7 +2857,7 @@  __get_extent_map(struct inode *inode, struct page *page, size_t pg_offset,
 		*em_cached = NULL;
 	}
 
-	em = get_extent(inode, page, pg_offset, start, len, 0);
+	em = get_extent(BTRFS_I(inode), page, pg_offset, start, len, 0);
 	if (em_cached && !IS_ERR_OR_NULL(em)) {
 		BUG_ON(*em_cached);
 		atomic_inc(&em->refs);
@@ -3370,7 +3370,7 @@  static noinline_for_stack int __extent_writepage_io(struct inode *inode,
 							 page_end, NULL, 1);
 			break;
 		}
-		em = epd->get_extent(inode, page, pg_offset, cur,
+		em = epd->get_extent(BTRFS_I(inode), page, pg_offset, cur,
 				     end - cur + 1, 1);
 		if (IS_ERR_OR_NULL(em)) {
 			SetPageError(page);
@@ -4335,7 +4335,7 @@  static struct extent_map *get_extent_skip_holes(struct inode *inode,
 		if (len == 0)
 			break;
 		len = ALIGN(len, sectorsize);
-		em = get_extent(inode, NULL, 0, offset, len, 0);
+		em = get_extent(BTRFS_I(inode), NULL, 0, offset, len, 0);
 		if (IS_ERR_OR_NULL(em))
 			return em;
 
diff --git a/fs/btrfs/extent_io.h b/fs/btrfs/extent_io.h
index 302e64be2e20..5e922e87abab 100644
--- a/fs/btrfs/extent_io.h
+++ b/fs/btrfs/extent_io.h
@@ -210,7 +210,7 @@  static inline int extent_compress_type(unsigned long bio_flags)
 
 struct extent_map_tree;
 
-typedef struct extent_map *(get_extent_t)(struct inode *inode,
+typedef struct extent_map *(get_extent_t)(struct btrfs_inode *inode,
 					  struct page *page,
 					  size_t pg_offset,
 					  u64 start, u64 len,
diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 2d534d6c5514..d3e25730cdf0 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -2334,7 +2334,7 @@  static int find_first_non_hole(struct inode *inode, u64 *start, u64 *len)
 	struct extent_map *em;
 	int ret = 0;
 
-	em = btrfs_get_extent(inode, NULL, 0, *start, *len, 0);
+	em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, *start, *len, 0);
 	if (IS_ERR_OR_NULL(em)) {
 		if (!em)
 			ret = -ENOMEM;
@@ -2824,7 +2824,7 @@  static long btrfs_fallocate(struct file *file, int mode,
 	/* First, check if we exceed the qgroup limit */
 	INIT_LIST_HEAD(&reserve_list);
 	while (1) {
-		em = btrfs_get_extent(inode, NULL, 0, cur_offset,
+		em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, cur_offset,
 				      alloc_end - cur_offset, 0);
 		if (IS_ERR_OR_NULL(em)) {
 			if (!em)
@@ -2951,7 +2951,7 @@  static int find_desired_extent(struct inode *inode, loff_t *offset, int whence)
 			 &cached_state);
 
 	while (start < inode->i_size) {
-		em = btrfs_get_extent_fiemap(inode, NULL, 0, start, len, 0);
+		em = btrfs_get_extent_fiemap(BTRFS_I(inode), NULL, 0, start, len, 0);
 		if (IS_ERR(em)) {
 			ret = PTR_ERR(em);
 			em = NULL;
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 1ba412440979..d78ec8d78781 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -4843,7 +4843,7 @@  int btrfs_cont_expand(struct inode *inode, loff_t oldsize, loff_t size)
 
 	cur_offset = hole_start;
 	while (1) {
-		em = btrfs_get_extent(inode, NULL, 0, cur_offset,
+		em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, cur_offset,
 				block_end - cur_offset, 0);
 		if (IS_ERR(em)) {
 			err = PTR_ERR(em);
@@ -6721,25 +6721,25 @@  static noinline int uncompress_inline(struct btrfs_path *path,
  * This also copies inline extents directly into the page.
  */
 
-struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
+struct extent_map *btrfs_get_extent(struct btrfs_inode *inode, struct page *page,
 				    size_t pg_offset, u64 start, u64 len,
 				    int create)
 {
-	struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
+	struct btrfs_fs_info *fs_info = btrfs_sb(inode->vfs_inode.i_sb);
 	int ret;
 	int err = 0;
 	u64 extent_start = 0;
 	u64 extent_end = 0;
-	u64 objectid = btrfs_ino(BTRFS_I(inode));
+	u64 objectid = btrfs_ino(inode);
 	u32 found_type;
 	struct btrfs_path *path = NULL;
-	struct btrfs_root *root = BTRFS_I(inode)->root;
+	struct btrfs_root *root = inode->root;
 	struct btrfs_file_extent_item *item;
 	struct extent_buffer *leaf;
 	struct btrfs_key found_key;
 	struct extent_map *em = NULL;
-	struct extent_map_tree *em_tree = &BTRFS_I(inode)->extent_tree;
-	struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree;
+	struct extent_map_tree *em_tree = &inode->extent_tree;
+	struct extent_io_tree *io_tree = &inode->io_tree;
 	struct btrfs_trans_handle *trans = NULL;
 	const bool new_inline = !page || create;
 
@@ -6852,7 +6852,7 @@  struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
 		goto not_found_em;
 	}
 
-	btrfs_extent_item_to_extent_map(BTRFS_I(inode), path, item, new_inline, em);
+	btrfs_extent_item_to_extent_map(inode, path, item, new_inline, em);
 
 	if (found_type == BTRFS_FILE_EXTENT_REG ||
 	    found_type == BTRFS_FILE_EXTENT_PREALLOC) {
@@ -6988,7 +6988,7 @@  struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
 	write_unlock(&em_tree->lock);
 out:
 
-	trace_btrfs_get_extent(root, BTRFS_I(inode), em);
+	trace_btrfs_get_extent(root, inode, em);
 
 	btrfs_free_path(path);
 	if (trans) {
@@ -7004,7 +7004,7 @@  struct extent_map *btrfs_get_extent(struct inode *inode, struct page *page,
 	return em;
 }
 
-struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *page,
+struct extent_map *btrfs_get_extent_fiemap(struct btrfs_inode *inode, struct page *page,
 					   size_t pg_offset, u64 start, u64 len,
 					   int create)
 {
@@ -7043,7 +7043,7 @@  struct extent_map *btrfs_get_extent_fiemap(struct inode *inode, struct page *pag
 	em = NULL;
 
 	/* ok, we didn't find anything, lets look for delalloc */
-	found = count_range_bits(&BTRFS_I(inode)->io_tree, &range_start,
+	found = count_range_bits(&inode->io_tree, &range_start,
 				 end, len, EXTENT_DELALLOC, 1);
 	found_end = range_start + found;
 	if (found_end < range_start)
@@ -7613,7 +7613,7 @@  static int btrfs_get_blocks_direct(struct inode *inode, sector_t iblock,
 		goto err;
 	}
 
-	em = btrfs_get_extent(inode, NULL, 0, start, len, 0);
+	em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len, 0);
 	if (IS_ERR(em)) {
 		ret = PTR_ERR(em);
 		goto unlock_err;
diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
index cdbf30e5743b..9011bd135223 100644
--- a/fs/btrfs/ioctl.c
+++ b/fs/btrfs/ioctl.c
@@ -1009,7 +1009,7 @@  static struct extent_map *defrag_lookup_extent(struct inode *inode, u64 start)
 
 		/* get the big lock and read metadata off disk */
 		lock_extent_bits(io_tree, start, end, &cached);
-		em = btrfs_get_extent(inode, NULL, 0, start, len, 0);
+		em = btrfs_get_extent(BTRFS_I(inode), NULL, 0, start, len, 0);
 		unlock_extent_cached(io_tree, start, end, &cached, GFP_NOFS);
 
 		if (IS_ERR(em))