[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220128115027.1170373-1-usama.anjum@collabora.com>
Date: Fri, 28 Jan 2022 16:50:27 +0500
From: Muhammad Usama Anjum <usama.anjum@...labora.com>
To: Chris Mason <clm@...com>, Josef Bacik <josef@...icpanda.com>,
David Sterba <dsterba@...e.com>, Qu Wenruo <wqu@...e.com>
Cc: Muhammad Usama Anjum <usama.anjum@...labora.com>,
kernel@...labora.com, kernel-janitors@...r.kernel.org,
linux-btrfs@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] btrfs: Remove dead code
Local variable stop_loop is assigned only once, to a constant value 0,
making it effectively constant through out its scope. This constant
variable is guarding deadcode. The two if conditions can never be true.
Remove the variable and make the logic simple.
Fixes: 585f784357d8 ("btrfs: use scrub_simple_mirror() to handle RAID56 data stripe scrub")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@...labora.com>
---
fs/btrfs/scrub.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/fs/btrfs/scrub.c b/fs/btrfs/scrub.c
index 4baa8e43d585b..26bbe93c3aa3c 100644
--- a/fs/btrfs/scrub.c
+++ b/fs/btrfs/scrub.c
@@ -3533,7 +3533,6 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
u64 offset; /* Offset inside the chunk */
u64 stripe_logical;
u64 stripe_end;
- int stop_loop = 0;
path = btrfs_alloc_path();
if (!path)
@@ -3652,14 +3651,8 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
logical += increment;
physical += map->stripe_len;
spin_lock(&sctx->stat_lock);
- if (stop_loop)
- sctx->stat.last_physical = map->stripes[stripe_index].physical +
- dev_extent_len;
- else
- sctx->stat.last_physical = physical;
+ sctx->stat.last_physical = physical;
spin_unlock(&sctx->stat_lock);
- if (stop_loop)
- break;
}
out:
/* push queued extents */
--
2.30.2
Powered by blists - more mailing lists