aboutsummaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorGuoqing Jiang2020-07-28 12:01:43 +0200
committerSong Liu2020-08-02 23:03:52 -0700
commit3a31cf3d210f85d57fd302d83514832ebacb3ca7 (patch)
tree36dcc6dec700e87b5e7df12d361e9b17345f778b /drivers/md
parent01b5d32a57fe83820d014485a4c41965bc3b5ce4 (diff)
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 <guoqing.jiang@cloud.ionos.com> Signed-off-by: Song Liu <songliubraving@fb.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/raid5.c9
1 files changed, 3 insertions, 6 deletions
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++;
}
}