Commit c6efe434 authored by Guoqing Jiang's avatar Guoqing Jiang Committed by Jens Axboe
Browse files

md/raid5: call roundup_pow_of_two in raid5_run



Let's call roundup_pow_of_two here instead of open code.

Signed-off-by: default avatarGuoqing Jiang <guoqing.jiang@linux.dev>
Signed-off-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent 2e94275e
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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;