Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

md: replace wait loop with wait_event() in md_handle_request()

The wait loop is equivalent to wait_event() and can be simplified by
usaing it for improving readability.

Signed-off-by: Abd-Alrhman Masalkhi <abd.masalkhi@gmail.com>
Link: https://lore.kernel.org/r/20260415140319.376578-2-abd.masalkhi@gmail.com
Signed-off-by: Yu Kuai <yukuai@fnnas.com>

authored by

Abd-Alrhman Masalkhi and committed by
Yu Kuai
8e8278ac 9aa6d860

+1 -9
+1 -9
drivers/md/md.c
··· 396 396 { 397 397 check_suspended: 398 398 if (is_suspended(mddev, bio)) { 399 - DEFINE_WAIT(__wait); 400 399 /* Bail out if REQ_NOWAIT is set for the bio */ 401 400 if (bio->bi_opf & REQ_NOWAIT) { 402 401 bio_wouldblock_error(bio); 403 402 return true; 404 403 } 405 - for (;;) { 406 - prepare_to_wait(&mddev->sb_wait, &__wait, 407 - TASK_UNINTERRUPTIBLE); 408 - if (!is_suspended(mddev, bio)) 409 - break; 410 - schedule(); 411 - } 412 - finish_wait(&mddev->sb_wait, &__wait); 404 + wait_event(mddev->sb_wait, !is_suspended(mddev, bio)); 413 405 } 414 406 if (!percpu_ref_tryget_live(&mddev->active_io)) 415 407 goto check_suspended;