btrfs: Remove redundant inode argument from btrfs_add_ordered_sum
authorNikolay Borisov <nborisov@suse.com>
Wed, 10 Apr 2019 13:16:11 +0000 (16:16 +0300)
committerDavid Sterba <dsterba@suse.com>
Mon, 29 Apr 2019 17:02:40 +0000 (19:02 +0200)
Ordered csums are keyed off of a btrfs_ordered_extent, which already has
a reference to the inode. This implies that an explicit inode argument
is redundant. So remove it.

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
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/ordered-data.c
fs/btrfs/ordered-data.h
fs/btrfs/relocation.c

index 0867fca..a120d6b 100644 (file)
@@ -469,7 +469,7 @@ blk_status_t btrfs_csum_one_bio(struct inode *inode, struct bio *bio,
 
                                sums->len = this_sum_bytes;
                                this_sum_bytes = 0;
-                               btrfs_add_ordered_sum(inode, ordered, sums);
+                               btrfs_add_ordered_sum(ordered, sums);
                                btrfs_put_ordered_extent(ordered);
 
                                bytes_left = bio->bi_iter.bi_size - total_bytes;
@@ -506,7 +506,7 @@ blk_status_t btrfs_csum_one_bio(struct inode *inode, struct bio *bio,
 
        }
        this_sum_bytes = 0;
-       btrfs_add_ordered_sum(inode, ordered, sums);
+       btrfs_add_ordered_sum(ordered, sums);
        btrfs_put_ordered_extent(ordered);
        return 0;
 }
index 45e3cfd..f6bb603 100644 (file)
@@ -271,13 +271,12 @@ int btrfs_add_ordered_extent_compress(struct inode *inode, u64 file_offset,
  * when an ordered extent is finished.  If the list covers more than one
  * ordered extent, it is split across multiples.
  */
-void btrfs_add_ordered_sum(struct inode *inode,
-                          struct btrfs_ordered_extent *entry,
+void btrfs_add_ordered_sum(struct btrfs_ordered_extent *entry,
                           struct btrfs_ordered_sum *sum)
 {
        struct btrfs_ordered_inode_tree *tree;
 
-       tree = &BTRFS_I(inode)->ordered_tree;
+       tree = &BTRFS_I(entry->inode)->ordered_tree;
        spin_lock_irq(&tree->lock);
        list_add_tail(&sum->list, &entry->list);
        spin_unlock_irq(&tree->lock);
index fb9a161..4c5991c 100644 (file)
@@ -167,8 +167,7 @@ int btrfs_add_ordered_extent_dio(struct inode *inode, u64 file_offset,
 int btrfs_add_ordered_extent_compress(struct inode *inode, u64 file_offset,
                                      u64 start, u64 len, u64 disk_len,
                                      int type, int compress_type);
-void btrfs_add_ordered_sum(struct inode *inode,
-                          struct btrfs_ordered_extent *entry,
+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,
                                                         u64 file_offset);
index 25fc6a4..2246aa2 100644 (file)
@@ -4604,7 +4604,7 @@ int btrfs_reloc_clone_csums(struct inode *inode, u64 file_pos, u64 len)
                new_bytenr = ordered->start + (sums->bytenr - disk_bytenr);
                sums->bytenr = new_bytenr;
 
-               btrfs_add_ordered_sum(inode, ordered, sums);
+               btrfs_add_ordered_sum(ordered, sums);
        }
 out:
        btrfs_put_ordered_extent(ordered);