[01/15] btrfs-progs: Remove root argument from pin_down_bytes
diff mbox

Message ID 1528462078-24490-2-git-send-email-nborisov@suse.com
State New
Headers show

Commit Message

Nikolay Borisov June 8, 2018, 12:47 p.m. UTC
This argument is used to obtain a reference to fs_info, which can
already be done from the passed trans handle, so use that instead.
This is in preparation for delayed refs support.

Signed-off-by: Nikolay Borisov <nborisov@suse.com>
---
 extent-tree.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

Comments

Qu Wenruo June 11, 2018, 4:41 a.m. UTC | #1
On 2018年06月08日 20:47, Nikolay Borisov wrote:
> This argument is used to obtain a reference to fs_info, which can
> already be done from the passed trans handle, so use that instead.
> This is in preparation for delayed refs support.
> 
> Signed-off-by: Nikolay Borisov <nborisov@suse.com>

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

Thanks,
Qu

> ---
>  extent-tree.c | 9 ++++-----
>  1 file changed, 4 insertions(+), 5 deletions(-)
> 
> diff --git a/extent-tree.c b/extent-tree.c
> index 0643815bd41c..cbc022f6cef6 100644
> --- a/extent-tree.c
> +++ b/extent-tree.c
> @@ -2098,9 +2098,8 @@ static int finish_current_insert(struct btrfs_trans_handle *trans)
>  	return 0;
>  }
>  
> -static int pin_down_bytes(struct btrfs_trans_handle *trans,
> -			  struct btrfs_root *root,
> -			  u64 bytenr, u64 num_bytes, int is_data)
> +static int pin_down_bytes(struct btrfs_trans_handle *trans, u64 bytenr,
> +			  u64 num_bytes, int is_data)
>  {
>  	int err = 0;
>  	struct extent_buffer *buf;
> @@ -2108,7 +2107,7 @@ static int pin_down_bytes(struct btrfs_trans_handle *trans,
>  	if (is_data)
>  		goto pinit;
>  
> -	buf = btrfs_find_tree_block(root->fs_info, bytenr, num_bytes);
> +	buf = btrfs_find_tree_block(trans->fs_info, bytenr, num_bytes);
>  	if (!buf)
>  		goto pinit;
>  
> @@ -2360,7 +2359,7 @@ static int __free_extent(struct btrfs_trans_handle *trans,
>  		}
>  
>  		if (pin) {
> -			ret = pin_down_bytes(trans, root, bytenr, num_bytes,
> +			ret = pin_down_bytes(trans, bytenr, num_bytes,
>  					     is_data);
>  			if (ret > 0)
>  				mark_free = 1;
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/extent-tree.c b/extent-tree.c
index 0643815bd41c..cbc022f6cef6 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -2098,9 +2098,8 @@  static int finish_current_insert(struct btrfs_trans_handle *trans)
 	return 0;
 }
 
-static int pin_down_bytes(struct btrfs_trans_handle *trans,
-			  struct btrfs_root *root,
-			  u64 bytenr, u64 num_bytes, int is_data)
+static int pin_down_bytes(struct btrfs_trans_handle *trans, u64 bytenr,
+			  u64 num_bytes, int is_data)
 {
 	int err = 0;
 	struct extent_buffer *buf;
@@ -2108,7 +2107,7 @@  static int pin_down_bytes(struct btrfs_trans_handle *trans,
 	if (is_data)
 		goto pinit;
 
-	buf = btrfs_find_tree_block(root->fs_info, bytenr, num_bytes);
+	buf = btrfs_find_tree_block(trans->fs_info, bytenr, num_bytes);
 	if (!buf)
 		goto pinit;
 
@@ -2360,7 +2359,7 @@  static int __free_extent(struct btrfs_trans_handle *trans,
 		}
 
 		if (pin) {
-			ret = pin_down_bytes(trans, root, bytenr, num_bytes,
+			ret = pin_down_bytes(trans, bytenr, num_bytes,
 					     is_data);
 			if (ret > 0)
 				mark_free = 1;