diff options
author | NeilBrown <neilb@suse.de> | 2006-01-06 03:20:16 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:34:03 -0500 |
commit | b15c2e57f0f5bf596a19e9c5571e5b07cdfc7363 (patch) | |
tree | da68e3ed72e59212936daf7dd4c86f1f9a7ab386 /drivers/md/bitmap.c | |
parent | 6ff8d8ec06690f4011a6c3ad9e0759b9094f0601 (diff) |
[PATCH] md: move bitmap_create to after md array has been initialised
This is important because bitmap_create uses
mddev->resync_max_sectors
and that doesn't have a valid value until after the array
has been initialised (with pers->run()).
[It doesn't make a difference for current personalities that
support bitmaps, but will make a difference for raid10]
This has the added advantage of meaning with can move the thread->timeout
manipulation inside the bitmap.c code instead of sprinkling identical code
throughout all personalities.
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 252d55df9642..b65c36d9e240 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c | |||
@@ -1530,6 +1530,8 @@ void bitmap_destroy(mddev_t *mddev) | |||
1530 | return; | 1530 | return; |
1531 | 1531 | ||
1532 | mddev->bitmap = NULL; /* disconnect from the md device */ | 1532 | mddev->bitmap = NULL; /* disconnect from the md device */ |
1533 | if (mddev->thread) | ||
1534 | mddev->thread->timeout = MAX_SCHEDULE_TIMEOUT; | ||
1533 | 1535 | ||
1534 | bitmap_free(bitmap); | 1536 | bitmap_free(bitmap); |
1535 | } | 1537 | } |
@@ -1636,6 +1638,8 @@ int bitmap_create(mddev_t *mddev) | |||
1636 | 1638 | ||
1637 | if (IS_ERR(bitmap->writeback_daemon)) | 1639 | if (IS_ERR(bitmap->writeback_daemon)) |
1638 | return PTR_ERR(bitmap->writeback_daemon); | 1640 | return PTR_ERR(bitmap->writeback_daemon); |
1641 | mddev->thread->timeout = bitmap->daemon_sleep * HZ; | ||
1642 | |||
1639 | return bitmap_update_sb(bitmap); | 1643 | return bitmap_update_sb(bitmap); |
1640 | 1644 | ||
1641 | error: | 1645 | error: |