md: support bitmap offset appropriate for external-metadata arrays.

For md arrays were metadata is managed externally, the kernel does not
know about a superblock so the superblock offset is 0.
If we want to have a write-intent-bitmap near the end of the
devices of such an array, we should support sector_t sized offset.
We need offset be possibly negative for when the bitmap is before
the metadata, so use loff_t instead.

Also add sanity check that bitmap does not overlap with data.

Signed-off-by: NeilBrown <neilb@suse.de>
This commit is contained in:
NeilBrown
2009-12-14 12:49:54 +11:00
parent 9cd30fdc33
commit f6af949c56
2 changed files with 15 additions and 5 deletions

View File

@@ -282,11 +282,13 @@ struct mddev_s
struct bitmap *bitmap; /* the bitmap for the device */
struct {
struct file *file; /* the bitmap file */
long offset; /* offset from superblock of
loff_t offset; /* offset from superblock of
* start of bitmap. May be
* negative, but not '0'
* For external metadata, offset
* from start of device.
*/
long default_offset; /* this is the offset to use when
loff_t default_offset; /* this is the offset to use when
* hot-adding a bitmap. It should
* eventually be settable by sysfs.
*/