From 0061ba125b25d29cd62d55c3499087b7a019a849 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Tue, 18 Feb 2025 01:33:23 +0100 Subject: [PATCH] btrfs: pass struct btrfs_inode to btrfs_double_mmap_lock() Pass a struct btrfs_inode to btrfs_double_mmap_lock() as it's an internal interface, allowing to remove some use of BTRFS_I. Reviewed-by: Johannes Thumshirn Signed-off-by: David Sterba --- fs/btrfs/reflink.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/btrfs/reflink.c b/fs/btrfs/reflink.c index 8640dbf1aefa..2e000e96d026 100644 --- a/fs/btrfs/reflink.c +++ b/fs/btrfs/reflink.c @@ -617,12 +617,12 @@ out: return ret; } -static void btrfs_double_mmap_lock(struct inode *inode1, struct inode *inode2) +static void btrfs_double_mmap_lock(struct btrfs_inode *inode1, struct btrfs_inode *inode2) { if (inode1 < inode2) swap(inode1, inode2); - down_write(&BTRFS_I(inode1)->i_mmap_lock); - down_write_nested(&BTRFS_I(inode2)->i_mmap_lock, SINGLE_DEPTH_NESTING); + down_write(&inode1->i_mmap_lock); + down_write_nested(&inode2->i_mmap_lock, SINGLE_DEPTH_NESTING); } static void btrfs_double_mmap_unlock(struct inode *inode1, struct inode *inode2) @@ -875,7 +875,7 @@ loff_t btrfs_remap_file_range(struct file *src_file, loff_t off, btrfs_inode_lock(BTRFS_I(src_inode), BTRFS_ILOCK_MMAP); } else { lock_two_nondirectories(src_inode, dst_inode); - btrfs_double_mmap_lock(src_inode, dst_inode); + btrfs_double_mmap_lock(BTRFS_I(src_inode), BTRFS_I(dst_inode)); } ret = btrfs_remap_file_range_prep(src_file, off, dst_file, destoff, -- 2.50.1