]> git.baikalelectronics.ru Git - kernel.git/commitdiff
btrfs: make btrfs_lookup_ordered_extent take btrfs_inode
authorNikolay Borisov <nborisov@suse.com>
Wed, 3 Jun 2020 05:55:03 +0000 (08:55 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 27 Jul 2020 10:55:25 +0000 (12:55 +0200)
It doesn't use the generic vfs inode for anything use btrfs_inode
directly.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file-item.c
fs/btrfs/inode.c
fs/btrfs/ioctl.c
fs/btrfs/ordered-data.c
fs/btrfs/ordered-data.h
fs/btrfs/relocation.c

index 706a3128e192060aceeef6516964af24903b4f7b..9d311e834b207472c7e555085dd15ac3eb4fe844 100644 (file)
@@ -522,10 +522,11 @@ fail:
  *              means this bio can contains potentially discontigous bio vecs
  *              so the logical offset of each should be calculated separately.
  */
-blk_status_t btrfs_csum_one_bio(struct inode *inode, struct bio *bio,
+blk_status_t btrfs_csum_one_bio(struct inode *vfsinode, struct bio *bio,
                       u64 file_start, int contig)
 {
-       struct btrfs_fs_info *fs_info = btrfs_sb(inode->i_sb);
+       struct btrfs_inode *inode = BTRFS_I(vfsinode);
+       struct btrfs_fs_info *fs_info = inode->root->fs_info;
        SHASH_DESC_ON_STACK(shash, fs_info->csum_shash);
        struct btrfs_ordered_sum *sums;
        struct btrfs_ordered_extent *ordered = NULL;
index 690549dc4073b0c8857d9af7f03a5c05b5a6b53d..bd69367452c823f26c077d749f4a0e16f8c4a587 100644 (file)
@@ -4558,7 +4558,7 @@ again:
        lock_extent_bits(io_tree, block_start, block_end, &cached_state);
        set_page_extent_mapped(page);
 
-       ordered = btrfs_lookup_ordered_extent(inode, block_start);
+       ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode), block_start);
        if (ordered) {
                unlock_extent_cached(io_tree, block_start, block_end,
                                     &cached_state);
index e8f7c5f008944035b746af003b61e4ed543374df..b3e4c632d80c4d1e86e6c099de0e2a01b4745f11 100644 (file)
@@ -1265,7 +1265,7 @@ again:
                while (1) {
                        lock_extent_bits(tree, page_start, page_end,
                                         &cached_state);
-                       ordered = btrfs_lookup_ordered_extent(inode,
+                       ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode),
                                                              page_start);
                        unlock_extent_cached(tree, page_start, page_end,
                                             &cached_state);
index dafa977bd6a20de6ca46b5c463dabc3f92506512..cb737729f6107ca71575da56bd23b6bc665dd4e7 100644 (file)
@@ -714,14 +714,14 @@ int btrfs_wait_ordered_range(struct inode *inode, u64 start, u64 len)
  * find an ordered extent corresponding to file_offset.  return NULL if
  * nothing is found, otherwise take a reference on the extent and return it
  */
-struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct inode *inode,
+struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct btrfs_inode *inode,
                                                         u64 file_offset)
 {
        struct btrfs_ordered_inode_tree *tree;
        struct rb_node *node;
        struct btrfs_ordered_extent *entry = NULL;
 
-       tree = &BTRFS_I(inode)->ordered_tree;
+       tree = &inode->ordered_tree;
        spin_lock_irq(&tree->lock);
        node = tree_search(tree, file_offset);
        if (!node)
@@ -819,7 +819,7 @@ int btrfs_find_ordered_sum(struct inode *inode, u64 offset, u64 disk_bytenr,
        const u16 csum_size = btrfs_super_csum_size(fs_info->super_copy);
        int index = 0;
 
-       ordered = btrfs_lookup_ordered_extent(inode, offset);
+       ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode), offset);
        if (!ordered)
                return 0;
 
index a24a1f2d5f9d92210c4771655e3c38d2a763a1d2..f2a78f8f6bcef75e105898f7b463158df5a7f2e1 100644 (file)
@@ -163,7 +163,7 @@ int btrfs_add_ordered_extent_compress(struct inode *inode, u64 file_offset,
                                      int compress_type);
 void btrfs_add_ordered_sum(struct btrfs_ordered_extent *entry,
                           struct btrfs_ordered_sum *sum);
-struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct inode *inode,
+struct btrfs_ordered_extent *btrfs_lookup_ordered_extent(struct btrfs_inode *inode,
                                                         u64 file_offset);
 void btrfs_start_ordered_extent(struct inode *inode,
                                struct btrfs_ordered_extent *entry, int wait);
index 11d1569954469a070a3d97d3fea50a905749f18b..8051aec5378ee6473e8365df623ed0229ae91ce0 100644 (file)
@@ -3880,7 +3880,7 @@ int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len)
        u64 new_bytenr;
        LIST_HEAD(list);
 
-       ordered = btrfs_lookup_ordered_extent(inode, file_pos);
+       ordered = btrfs_lookup_ordered_extent(BTRFS_I(inode), file_pos);
        BUG_ON(ordered->file_offset != file_pos || ordered->num_bytes != len);
 
        disk_bytenr = file_pos + BTRFS_I(inode)->index_cnt;