summaryrefslogtreecommitdiffstats
path: root/drivers/md/md.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2014-09-09 14:20:28 +1000
committerNeilBrown <neilb@suse.de>2014-10-14 13:08:28 +1100
commit1967cd5616c4792ef9d3cbaafe5fbe12fc429c9e (patch)
tree2345878c17c5e2e4e133a85902fa32680e484dc0 /drivers/md/md.c
parent9ba3b7f5d025915be2b8709e5fd35c9c3e9f14c6 (diff)
downloadlinux-1967cd5616c4792ef9d3cbaafe5fbe12fc429c9e.tar.gz
linux-1967cd5616c4792ef9d3cbaafe5fbe12fc429c9e.tar.bz2
linux-1967cd5616c4792ef9d3cbaafe5fbe12fc429c9e.zip
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: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/md.c')
-rw-r--r--drivers/md/md.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4c72e9626eff..6be7146be5b3 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -766,14 +766,7 @@ void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
void md_super_wait(struct mddev *mddev)
{
/* wait for all superblock writes that were scheduled to complete */
- DEFINE_WAIT(wq);
- 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);
+ wait_event(mddev->sb_wait, atomic_read(&mddev->pending_writes)==0);
}
int sync_page_io(struct md_rdev *rdev, sector_t sector, int size,