Skip to content

Commit

Permalink
raid5: don't duplicate code for different paths in handle_stripe
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Guoqing Jiang authored and Song Liu committed Aug 3, 2020
1 parent 01b5d32 commit 3a31cf3
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
@@ -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++;
}
}

0 comments on commit 3a31cf3

Please sign in to comment.