btrfs: Remove dead code
Subsystems (2)
PATCH 1/1 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 <[email protected]>
--- fs/btrfs/scrub.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
fs/btrfs/scrub.c +1 -8
@@ -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 */
Signature · 1 line
2.30.2
Quoted 6 lines · Muhammad Usama Anjum
Local variable
stop_loopis 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")
Thanks, this patch is still only in for-next so the change can be folded into it.