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>
This commit is contained in:
Guoqing Jiang 2020-07-28 12:01:43 +02:00 коммит произвёл Song Liu
Родитель 01b5d32a57
Коммит 3a31cf3d21
1 изменённых файлов: 3 добавлений и 6 удалений

Просмотреть файл

@ -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++;
}
}