Commit f5169f12 authored by Filipe Manana's avatar Filipe Manana Committed by David Sterba

btrfs: stop passing root argument to __btrfs_del_delalloc_inode()

There's no need to pass a root argument to __btrfs_del_delalloc_inode()
and btrfs_del_delalloc_inode(), we can just pass the inode since the root
is always the root associated to that inode. Some remove the root argument
from these functions.
Reviewed-by: default avatarBoris Burkov <boris@bur.io>
Reviewed-by: default avatarQu Wenruo <wqu@suse.com>
Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
Reviewed-by: default avatarDavid Sterba <dsterba@suse.com>
Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 8a46e55a
...@@ -447,7 +447,7 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len, ...@@ -447,7 +447,7 @@ noinline int can_nocow_extent(struct inode *inode, u64 offset, u64 *len,
u64 *orig_start, u64 *orig_block_len, u64 *orig_start, u64 *orig_block_len,
u64 *ram_bytes, bool nowait, bool strict); u64 *ram_bytes, bool nowait, bool strict);
void __btrfs_del_delalloc_inode(struct btrfs_root *root, struct btrfs_inode *inode); void __btrfs_del_delalloc_inode(struct btrfs_inode *inode);
struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry); struct inode *btrfs_lookup_dentry(struct inode *dir, struct dentry *dentry);
int btrfs_set_inode_index(struct btrfs_inode *dir, u64 *index); int btrfs_set_inode_index(struct btrfs_inode *dir, u64 *index);
int btrfs_unlink_inode(struct btrfs_trans_handle *trans, int btrfs_unlink_inode(struct btrfs_trans_handle *trans,
......
...@@ -4629,7 +4629,7 @@ static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root) ...@@ -4629,7 +4629,7 @@ static void btrfs_destroy_delalloc_inodes(struct btrfs_root *root)
struct inode *inode = NULL; struct inode *inode = NULL;
btrfs_inode = list_first_entry(&splice, struct btrfs_inode, btrfs_inode = list_first_entry(&splice, struct btrfs_inode,
delalloc_inodes); delalloc_inodes);
__btrfs_del_delalloc_inode(root, btrfs_inode); __btrfs_del_delalloc_inode(btrfs_inode);
spin_unlock(&root->delalloc_lock); spin_unlock(&root->delalloc_lock);
/* /*
......
...@@ -2406,9 +2406,9 @@ static void btrfs_add_delalloc_inodes(struct btrfs_inode *inode) ...@@ -2406,9 +2406,9 @@ static void btrfs_add_delalloc_inodes(struct btrfs_inode *inode)
spin_unlock(&root->delalloc_lock); spin_unlock(&root->delalloc_lock);
} }
void __btrfs_del_delalloc_inode(struct btrfs_root *root, void __btrfs_del_delalloc_inode(struct btrfs_inode *inode)
struct btrfs_inode *inode)
{ {
struct btrfs_root *root = inode->root;
struct btrfs_fs_info *fs_info = root->fs_info; struct btrfs_fs_info *fs_info = root->fs_info;
if (!list_empty(&inode->delalloc_inodes)) { if (!list_empty(&inode->delalloc_inodes)) {
...@@ -2426,12 +2426,11 @@ void __btrfs_del_delalloc_inode(struct btrfs_root *root, ...@@ -2426,12 +2426,11 @@ void __btrfs_del_delalloc_inode(struct btrfs_root *root,
} }
} }
static void btrfs_del_delalloc_inode(struct btrfs_root *root, static void btrfs_del_delalloc_inode(struct btrfs_inode *inode)
struct btrfs_inode *inode)
{ {
spin_lock(&root->delalloc_lock); spin_lock(&inode->root->delalloc_lock);
__btrfs_del_delalloc_inode(root, inode); __btrfs_del_delalloc_inode(inode);
spin_unlock(&root->delalloc_lock); spin_unlock(&inode->root->delalloc_lock);
} }
/* /*
...@@ -2538,7 +2537,7 @@ void btrfs_clear_delalloc_extent(struct btrfs_inode *inode, ...@@ -2538,7 +2537,7 @@ void btrfs_clear_delalloc_extent(struct btrfs_inode *inode,
if (do_list && inode->delalloc_bytes == 0 && if (do_list && inode->delalloc_bytes == 0 &&
test_bit(BTRFS_INODE_IN_DELALLOC_LIST, test_bit(BTRFS_INODE_IN_DELALLOC_LIST,
&inode->runtime_flags)) &inode->runtime_flags))
btrfs_del_delalloc_inode(root, inode); btrfs_del_delalloc_inode(inode);
spin_unlock(&inode->lock); spin_unlock(&inode->lock);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment