From 3a31cf3d210f85d57fd302d83514832ebacb3ca7 Mon Sep 17 00:00:00 2001 From: Guoqing Jiang Date: Tue, 28 Jul 2020 12:01:43 +0200 Subject: raid5: don't duplicate code for different paths in handle_stripe As we can see, R5_LOCKED is set and s.locked is increased whether R5_ReWrite is set or not, so move it to common path. Signed-off-by: Guoqing Jiang Signed-off-by: Song Liu --- drivers/md/raid5.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'drivers/md/raid5.c') diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 790d91aa5f40..b06edfaa73b0 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c @@ -4966,14 +4966,11 @@ static void handle_stripe(struct stripe_head *sh) if (!test_bit(R5_ReWrite, &dev->flags)) { set_bit(R5_Wantwrite, &dev->flags); set_bit(R5_ReWrite, &dev->flags); - set_bit(R5_LOCKED, &dev->flags); - s.locked++; - } else { + } else /* let's read it back */ set_bit(R5_Wantread, &dev->flags); - set_bit(R5_LOCKED, &dev->flags); - s.locked++; - } + set_bit(R5_LOCKED, &dev->flags); + s.locked++; } } -- cgit v1.2.3