Commit 1967cd56 authored by NeilBrown's avatar NeilBrown

md: use wait_event() to simplify md_super_wait()

md_super_wait is really just wait_event() open-coded.
So use the macro instead.
Signed-off-by: default avatarNeilBrown <neilb@suse.de>
parent 9ba3b7f5
...@@ -766,14 +766,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev, ...@@ -766,14 +766,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
void md_super_wait(struct mddev *mddev) void md_super_wait(struct mddev *mddev)
{ {
/* wait for all superblock writes that were scheduled to complete */ /* wait for all superblock writes that were scheduled to complete */
DEFINE_WAIT(wq); wait_event(mddev->sb_wait, atomic_read(&mddev->pending_writes)==0);
for(;;) {
prepare_to_wait(&mddev->sb_wait, &wq, TASK_UNINTERRUPTIBLE);
if (atomic_read(&mddev->pending_writes)==0)
break;
schedule();
}
finish_wait(&mddev->sb_wait, &wq);
} }
int sync_page_io(struct md_rdev *rdev, sector_t sector, int size, int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment