diff mbox

[5/6] btrfs-progs: do clean up for redundancy value assignment

Message ID 1516936926-18707-5-git-send-email-gujx@cn.fujitsu.com (mailing list archive)
State New, archived
Headers show

Commit Message

Gu Jinxiang Jan. 26, 2018, 3:22 a.m. UTC
Although skinny_metadata's type is int, its value just can be 0/1.
And if condition be true only when skinny_metadata equals 1,
so in if's executive part, set skinny_metadata to 1 is redundancy.
Remove it.

Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>
---
 extent-tree.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Qu Wenruo Jan. 26, 2018, 5:34 a.m. UTC | #1
On 2018年01月26日 11:22, Gu Jinxiang wrote:
> Although skinny_metadata's type is int, its value just can be 0/1.
> And if condition be true only when skinny_metadata equals 1,
> so in if's executive part, set skinny_metadata to 1 is redundancy.
> Remove it.
> 
> Signed-off-by: Gu Jinxiang <gujx@cn.fujitsu.com>

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

Thanks,
Qu

> ---
>  extent-tree.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/extent-tree.c b/extent-tree.c
> index 1ac312a6..53d31ab3 100644
> --- a/extent-tree.c
> +++ b/extent-tree.c
> @@ -1005,7 +1005,6 @@ static int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
>  		extra_size = -1;
>  
>  	if (owner < BTRFS_FIRST_FREE_OBJECTID && skinny_metadata) {
> -		skinny_metadata = 1;
>  		key.type = BTRFS_METADATA_ITEM_KEY;
>  		key.offset = owner;
>  	} else if (skinny_metadata) {
>
diff mbox

Patch

diff --git a/extent-tree.c b/extent-tree.c
index 1ac312a6..53d31ab3 100644
--- a/extent-tree.c
+++ b/extent-tree.c
@@ -1005,7 +1005,6 @@  static int lookup_inline_extent_backref(struct btrfs_trans_handle *trans,
 		extra_size = -1;
 
 	if (owner < BTRFS_FIRST_FREE_OBJECTID && skinny_metadata) {
-		skinny_metadata = 1;
 		key.type = BTRFS_METADATA_ITEM_KEY;
 		key.offset = owner;
 	} else if (skinny_metadata) {