diff options
author | NeilBrown <neilb@suse.de> | 2012-05-22 13:55:25 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2012-05-22 13:55:25 +1000 |
commit | d60b479d177a5735b6b4db6ee5280ef6653f50e7 (patch) | |
tree | 8fc110bc113817f237559da6da68ca2a75e3614c /drivers/md/bitmap.h | |
parent | 15702d7fb6e7a6baf5a04286a227b0ad2fe4a03f (diff) | |
download | blackbird-obmc-linux-d60b479d177a5735b6b4db6ee5280ef6653f50e7.tar.gz blackbird-obmc-linux-d60b479d177a5735b6b4db6ee5280ef6653f50e7.zip |
md/bitmap: add bitmap_resize function to allow bitmap resizing.
This function will allocate the new data structures and copy
bits across from old to new, allowing for the possibility that the
chunksize has changed.
Use the same function for performing the initial allocation
of the structures. This improves test coverage.
When bitmap_resize is used to resize an existing bitmap, it
only copies '1' bits in, not '0' bits.
So when allocating the bitmap, ensure everything is initialised
to ZERO.
Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'drivers/md/bitmap.h')
-rw-r--r-- | drivers/md/bitmap.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h index 6bde180e987b..04dcde3871be 100644 --- a/drivers/md/bitmap.h +++ b/drivers/md/bitmap.h @@ -255,6 +255,9 @@ void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector); void bitmap_unplug(struct bitmap *bitmap); void bitmap_daemon_work(struct mddev *mddev); + +int bitmap_resize(struct bitmap *bitmap, sector_t blocks, + int chunksize, int init); #endif #endif |