diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-09-09 19:23:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-09-09 19:39:10 -0400 |
commit | 36fa30636fb84b209210299684e1be66d9e58217 (patch) | |
tree | 28a7473238932f1e7ade1a5a5ec67a113b6d6205 /drivers/md/raid1.c | |
parent | 6a07997fc34ac15a1c5dc650285d79b7604a2276 (diff) |
[PATCH] md: all hot-add and hot-remove of md intent logging bitmaps
Both file-bitmaps and superblock bitmaps are supported.
If you add a bitmap file on the array device, you lose.
This introduces a 'default_bitmap_offset' field in mddev, as the ioctl used
for adding a superblock bitmap doesn't have room for giving an offset. Later,
this value will be setable via sysfs.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
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) |