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/raid1: replace wait loop with wait_event_idle() in raid1_write_request()

The wait loop is equivalent to wait_event_idle(); use it to improve
readability.

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

authored by

Abd-Alrhman Masalkhi and committed by
Yu Kuai
c1a3cdb0 f2926a53

+4 -11
+4 -11
drivers/md/raid1.c
··· 1510 1510 mddev->cluster_ops->area_resyncing(mddev, WRITE, 1511 1511 bio->bi_iter.bi_sector, bio_end_sector(bio))) { 1512 1512 1513 - DEFINE_WAIT(w); 1514 1513 if (bio->bi_opf & REQ_NOWAIT) { 1515 1514 bio_wouldblock_error(bio); 1516 1515 return; 1517 1516 } 1518 - for (;;) { 1519 - prepare_to_wait(&conf->wait_barrier, 1520 - &w, TASK_IDLE); 1521 - if (!mddev->cluster_ops->area_resyncing(mddev, WRITE, 1522 - bio->bi_iter.bi_sector, 1523 - bio_end_sector(bio))) 1524 - break; 1525 - schedule(); 1526 - } 1527 - finish_wait(&conf->wait_barrier, &w); 1517 + wait_event_idle(conf->wait_barrier, 1518 + !mddev->cluster_ops->area_resyncing(mddev, WRITE, 1519 + bio->bi_iter.bi_sector, 1520 + bio_end_sector(bio))); 1528 1521 } 1529 1522 1530 1523 /*