diff options
Diffstat (limited to 'drivers/md/raid1.c')
-rw-r--r-- | drivers/md/raid1.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index ace41c571aeb..ba643e4bfac9 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c | |||
@@ -1565,6 +1565,35 @@ static int raid1_reshape(mddev_t *mddev, int raid_disks) | |||
1565 | return 0; | 1565 | return 0; |
1566 | } | 1566 | } |
1567 | 1567 | ||
1568 | void raid1_quiesce(mddev_t *mddev, int state) | ||
1569 | { | ||
1570 | conf_t *conf = mddev_to_conf(mddev); | ||
1571 | |||
1572 | switch(state) { | ||
1573 | case 0: | ||
1574 | spin_lock_irq(&conf->resync_lock); | ||
1575 | conf->barrier++; | ||
1576 | wait_event_lock_irq(conf->wait_idle, !conf->nr_pending, | ||
1577 | conf->resync_lock, raid1_unplug(mddev->queue)); | ||
1578 | spin_unlock_irq(&conf->resync_lock); | ||
1579 | break; | ||
1580 | case 1: | ||
1581 | spin_lock_irq(&conf->resync_lock); | ||
1582 | conf->barrier--; | ||
1583 | spin_unlock_irq(&conf->resync_lock); | ||
1584 | wake_up(&conf->wait_resume); | ||
1585 | wake_up(&conf->wait_idle); | ||
1586 | break; | ||
1587 | } | ||
1588 | if (mddev->thread) { | ||
1589 | if (mddev->bitmap) | ||
1590 | mddev->thread->timeout = mddev->bitmap->daemon_sleep * HZ; | ||
1591 | else | ||
1592 | mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT; | ||
1593 | md_wakeup_thread(mddev->thread); | ||
1594 | } | ||
1595 | } | ||
1596 | |||
1568 | 1597 | ||
1569 | static mdk_personality_t raid1_personality = | 1598 | static mdk_personality_t raid1_personality = |
1570 | { | 1599 | { |
@@ -1581,6 +1610,7 @@ static mdk_personality_t raid1_personality = | |||
1581 | .sync_request = sync_request, | 1610 | .sync_request = sync_request, |
1582 | .resize = raid1_resize, | 1611 | .resize = raid1_resize, |
1583 | .reshape = raid1_reshape, | 1612 | .reshape = raid1_reshape, |
1613 | .quiesce = raid1_quiesce, | ||
1584 | }; | 1614 | }; |
1585 | 1615 | ||
1586 | static int __init raid_init(void) | 1616 | static int __init raid_init(void) |