diff mbox series

[5/8] btrfs: remove redundant root argument from btrfs_update_inode_item()

Message ID 4472470053d1a06d99e80292f6a2fe06d6f40041.1695333082.git.fdmanana@suse.com (mailing list archive)
State New, archived
Headers show
Series btrfs: some cleanups around inode update and helpers | expand

Commit Message

Filipe Manana Sept. 22, 2023, 10:37 a.m. UTC
From: Filipe Manana <fdmanana@suse.com>

The root argument for btrfs_update_inode_item() always matches the root of
the given inode, so remove the root argument and get it from the inode
argument.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
---
 fs/btrfs/inode.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Qu Wenruo Sept. 22, 2023, 10:06 p.m. UTC | #1
On 2023/9/22 20:07, fdmanana@kernel.org wrote:
> From: Filipe Manana <fdmanana@suse.com>
>
> The root argument for btrfs_update_inode_item() always matches the root of
> the given inode, so remove the root argument and get it from the inode
> argument.
>
> Signed-off-by: Filipe Manana <fdmanana@suse.com>

Reviewed-by: Qu Wenruo <wqu@suse.com>

Thanks,
Qu
> ---
>   fs/btrfs/inode.c | 9 ++++-----
>   1 file changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index 13a97d3ce34a..c4b5d4047c5d 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -3966,8 +3966,7 @@ static void fill_inode_item(struct btrfs_trans_handle *trans,
>    * copy everything in the in-memory inode into the btree.
>    */
>   static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans,
> -				struct btrfs_root *root,
> -				struct btrfs_inode *inode)
> +					    struct btrfs_inode *inode)
>   {
>   	struct btrfs_inode_item *inode_item;
>   	struct btrfs_path *path;
> @@ -3978,7 +3977,7 @@ static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans,
>   	if (!path)
>   		return -ENOMEM;
>
> -	ret = btrfs_lookup_inode(trans, root, path, &inode->location, 1);
> +	ret = btrfs_lookup_inode(trans, inode->root, path, &inode->location, 1);
>   	if (ret) {
>   		if (ret > 0)
>   			ret = -ENOENT;
> @@ -4026,7 +4025,7 @@ int btrfs_update_inode(struct btrfs_trans_handle *trans,
>   		return ret;
>   	}
>
> -	return btrfs_update_inode_item(trans, root, inode);
> +	return btrfs_update_inode_item(trans, inode);
>   }
>
>   int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
> @@ -4036,7 +4035,7 @@ int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
>
>   	ret = btrfs_update_inode(trans, inode);
>   	if (ret == -ENOSPC)
> -		return btrfs_update_inode_item(trans, inode->root, inode);
> +		return btrfs_update_inode_item(trans, inode);
>   	return ret;
>   }
>
diff mbox series

Patch

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 13a97d3ce34a..c4b5d4047c5d 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -3966,8 +3966,7 @@  static void fill_inode_item(struct btrfs_trans_handle *trans,
  * copy everything in the in-memory inode into the btree.
  */
 static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans,
-				struct btrfs_root *root,
-				struct btrfs_inode *inode)
+					    struct btrfs_inode *inode)
 {
 	struct btrfs_inode_item *inode_item;
 	struct btrfs_path *path;
@@ -3978,7 +3977,7 @@  static noinline int btrfs_update_inode_item(struct btrfs_trans_handle *trans,
 	if (!path)
 		return -ENOMEM;
 
-	ret = btrfs_lookup_inode(trans, root, path, &inode->location, 1);
+	ret = btrfs_lookup_inode(trans, inode->root, path, &inode->location, 1);
 	if (ret) {
 		if (ret > 0)
 			ret = -ENOENT;
@@ -4026,7 +4025,7 @@  int btrfs_update_inode(struct btrfs_trans_handle *trans,
 		return ret;
 	}
 
-	return btrfs_update_inode_item(trans, root, inode);
+	return btrfs_update_inode_item(trans, inode);
 }
 
 int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
@@ -4036,7 +4035,7 @@  int btrfs_update_inode_fallback(struct btrfs_trans_handle *trans,
 
 	ret = btrfs_update_inode(trans, inode);
 	if (ret == -ENOSPC)
-		return btrfs_update_inode_item(trans, inode->root, inode);
+		return btrfs_update_inode_item(trans, inode);
 	return ret;
 }