mirror of
https://github.com/torvalds/linux.git
synced 2026-07-31 19:47:08 +02:00
btrfs: remove redundant stop_loop variable in scrub_stripe()
The variable stop_loop was originally introduced in commit625f1c8dc6("Btrfs: improve the loop of scrub_stripe"). It was initialized to 0 in commit3b080b2564("Btrfs: scrub raid56 stripes in the right way"). However, in a later commit18d30ab961("btrfs: scrub: use scrub_simple_mirror() to handle RAID56 data stripe scrub"), the code that modified stop_loop was removed, making the variable redundant. Currently, stop_loop is only initialized with 0 and is never used or modified within the scrub_stripe() function. As a result, this patch removes the stop_loop variable to clean up the code and eliminate unnecessary redundancy. This change has no impact on functionality, as stop_loop was never utilized in any meaningful way in the final version of the code. Reviewed-by: Filipe Manana <fdmanana@suse.com> Signed-off-by: Riyan Dhiman <riyandhiman14@gmail.com> Reviewed-by: David Sterba <dsterba@suse.com> Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
287d1cf303
commit
522945b342
|
|
@ -2256,7 +2256,6 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
|
|||
/* Offset inside the chunk */
|
||||
u64 offset;
|
||||
u64 stripe_logical;
|
||||
int stop_loop = 0;
|
||||
|
||||
/* Extent_path should be released by now. */
|
||||
ASSERT(sctx->extent_path.nodes[0] == NULL);
|
||||
|
|
@ -2370,14 +2369,8 @@ static noinline_for_stack int scrub_stripe(struct scrub_ctx *sctx,
|
|||
logical += increment;
|
||||
physical += BTRFS_STRIPE_LEN;
|
||||
spin_lock(&sctx->stat_lock);
|
||||
if (stop_loop)
|
||||
sctx->stat.last_physical =
|
||||
map->stripes[stripe_index].physical + dev_stripe_len;
|
||||
else
|
||||
sctx->stat.last_physical = physical;
|
||||
sctx->stat.last_physical = physical;
|
||||
spin_unlock(&sctx->stat_lock);
|
||||
if (stop_loop)
|
||||
break;
|
||||
}
|
||||
out:
|
||||
ret2 = flush_scrub_stripes(sctx);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user