summaryrefslogtreecommitdiff
path: root/fs/btrfs/defrag.c
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.com>2022-10-27 02:41:32 +0200
committerDavid Sterba <dsterba@suse.com>2022-12-05 18:00:53 +0100
commit29b6352b1494bd7ec6a14bda087f8eb858d2fc1f (patch)
treef7fd753391a9ce067a9780b9baa1e80e07cc8f19 /fs/btrfs/defrag.c
parentd9dcae67b7fe1f8c7d974a7a002c81d9b02b7281 (diff)
downloadlwn-29b6352b1494bd7ec6a14bda087f8eb858d2fc1f.tar.gz
lwn-29b6352b1494bd7ec6a14bda087f8eb858d2fc1f.zip
btrfs: pass btrfs_inode to btrfs_inode_lock
The function is for internal interfaces so we should use the btrfs_inode. Reviewed-by: Anand Jain <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/defrag.c')
-rw-r--r--fs/btrfs/defrag.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/btrfs/defrag.c b/fs/btrfs/defrag.c
index 919dfe0f7e50..6aade4838927 100644
--- a/fs/btrfs/defrag.c
+++ b/fs/btrfs/defrag.c
@@ -1295,7 +1295,7 @@ int btrfs_defrag_file(struct inode *inode, struct file_ra_state *ra,
(SZ_256K >> PAGE_SHIFT)) << PAGE_SHIFT) - 1;
cluster_end = min(cluster_end, last_byte);
- btrfs_inode_lock(inode, 0);
+ btrfs_inode_lock(BTRFS_I(inode), 0);
if (IS_SWAPFILE(inode)) {
ret = -ETXTBSY;
btrfs_inode_unlock(inode, 0);
@@ -1351,7 +1351,7 @@ int btrfs_defrag_file(struct inode *inode, struct file_ra_state *ra,
ret = sectors_defragged;
}
if (do_compress) {
- btrfs_inode_lock(inode, 0);
+ btrfs_inode_lock(BTRFS_I(inode), 0);
BTRFS_I(inode)->defrag_compress = BTRFS_COMPRESS_NONE;
btrfs_inode_unlock(inode, 0);
}