diff options
author | Jonathan Brassow <jbrassow@redhat.com> | 2011-01-13 23:14:34 +0100 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-01-13 23:14:34 +0100 |
commit | a6ff7e089c7fca813c956ccbed824087e89a3a49 (patch) | |
tree | 6537f72a2431c30601736676e9b1f89a7f1fe52e /drivers/md/bitmap.c | |
parent | md-new-param-to_sync_page_io (diff) | |
download | linux-a6ff7e089c7fca813c956ccbed824087e89a3a49.tar.xz linux-a6ff7e089c7fca813c956ccbed824087e89a3a49.zip |
md: separate meta and data devs
Allow the metadata to be on a separate device from the
data.
This doesn't mean the data and metadata will by on separate
physical devices - it simply gives device-mapper and userspace
tools more flexibility.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r-- | drivers/md/bitmap.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c index 1977765ff964..6cf587196b99 100644 --- a/drivers/md/bitmap.c +++ b/drivers/md/bitmap.c @@ -264,14 +264,18 @@ static mdk_rdev_t *next_active_rdev(mdk_rdev_t *rdev, mddev_t *mddev) static int write_sb_page(struct bitmap *bitmap, struct page *page, int wait) { mdk_rdev_t *rdev = NULL; + struct block_device *bdev; mddev_t *mddev = bitmap->mddev; while ((rdev = next_active_rdev(rdev, mddev)) != NULL) { int size = PAGE_SIZE; loff_t offset = mddev->bitmap_info.offset; + + bdev = (rdev->meta_bdev) ? rdev->meta_bdev : rdev->bdev; + if (page->index == bitmap->file_pages-1) size = roundup(bitmap->last_page_size, - bdev_logical_block_size(rdev->bdev)); + bdev_logical_block_size(bdev)); /* Just make sure we aren't corrupting data or * metadata */ |