Skip to content

Commit

Permalink
md/raid5: call roundup_pow_of_two in raid5_run
Browse files Browse the repository at this point in the history
Let's call roundup_pow_of_two here instead of open code.

Signed-off-by: Guoqing Jiang <guoqing.jiang@linux.dev>
Signed-off-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
  • Loading branch information
Guoqing Jiang authored and Jens Axboe committed Oct 18, 2021
1 parent 2e94275 commit c6efe43
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/md/raid5.c
Original file line number Diff line number Diff line change
Expand Up @@ -7732,10 +7732,7 @@ static int raid5_run(struct mddev *mddev)
* discard data disk but write parity disk
*/
stripe = stripe * PAGE_SIZE;
/* Round up to power of 2, as discard handling
* currently assumes that */
while ((stripe-1) & stripe)
stripe = (stripe | (stripe-1)) + 1;
stripe = roundup_pow_of_two(stripe);
mddev->queue->limits.discard_alignment = stripe;
mddev->queue->limits.discard_granularity = stripe;

Expand Down

0 comments on commit c6efe43

Please sign in to comment.