Skip to content

Commit 651cef4

Browse files
committed
btrfs: pass struct btrfs_inode to btrfs_double_mmap_unlock()
Pass a struct btrfs_inode to btrfs_double_mmap_unlock() as it's an internal interface, allowing to remove some use of BTRFS_I. Reviewed-by: Johannes Thumshirn <johannes.thumshirn@wdc.com> Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 0061ba1 commit 651cef4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

fs/btrfs/reflink.c

+4-4
Original file line numberDiff line numberDiff line change
@@ -625,10 +625,10 @@ static void btrfs_double_mmap_lock(struct btrfs_inode *inode1, struct btrfs_inod
625625
down_write_nested(&inode2->i_mmap_lock, SINGLE_DEPTH_NESTING);
626626
}
627627

628-
static void btrfs_double_mmap_unlock(struct inode *inode1, struct inode *inode2)
628+
static void btrfs_double_mmap_unlock(struct btrfs_inode *inode1, struct btrfs_inode *inode2)
629629
{
630-
up_write(&BTRFS_I(inode1)->i_mmap_lock);
631-
up_write(&BTRFS_I(inode2)->i_mmap_lock);
630+
up_write(&inode1->i_mmap_lock);
631+
up_write(&inode2->i_mmap_lock);
632632
}
633633

634634
static int btrfs_extent_same_range(struct inode *src, u64 loff, u64 len,
@@ -892,7 +892,7 @@ loff_t btrfs_remap_file_range(struct file *src_file, loff_t off,
892892
if (same_inode) {
893893
btrfs_inode_unlock(BTRFS_I(src_inode), BTRFS_ILOCK_MMAP);
894894
} else {
895-
btrfs_double_mmap_unlock(src_inode, dst_inode);
895+
btrfs_double_mmap_unlock(BTRFS_I(src_inode), BTRFS_I(dst_inode));
896896
unlock_two_nondirectories(src_inode, dst_inode);
897897
}
898898

0 commit comments

Comments
 (0)