aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/drbd/drbd_bitmap.c
diff options
context:
space:
mode:
authorPhilipp Reisner <philipp.reisner@linbit.com>2010-03-24 11:23:03 -0400
committerPhilipp Reisner <philipp.reisner@linbit.com>2010-05-17 19:14:43 -0400
commit02d9a94bbb0d4e0fec8db6735bdc4ccfaac8f0ce (patch)
treef8a2c63b8b84e0aef6d7e8fc920b20c5bb14c1c4 /drivers/block/drbd/drbd_bitmap.c
parentd845030f21859dd11bcecc7e1b8575fb845eb425 (diff)
drbd: Implemented the set_new_bits parameter for drbd_bm_resize()
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com> Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_bitmap.c')
-rw-r--r--drivers/block/drbd/drbd_bitmap.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/block/drbd/drbd_bitmap.c b/drivers/block/drbd/drbd_bitmap.c
index 3390716898d5..695fb64cba00 100644
--- a/drivers/block/drbd/drbd_bitmap.c
+++ b/drivers/block/drbd/drbd_bitmap.c
@@ -441,7 +441,7 @@ static void bm_memset(struct drbd_bitmap *b, size_t offset, int c, size_t len)
441 * In case this is actually a resize, we copy the old bitmap into the new one. 441 * In case this is actually a resize, we copy the old bitmap into the new one.
442 * Otherwise, the bitmap is initialized to all bits set. 442 * Otherwise, the bitmap is initialized to all bits set.
443 */ 443 */
444int drbd_bm_resize(struct drbd_conf *mdev, sector_t capacity) 444int drbd_bm_resize(struct drbd_conf *mdev, sector_t capacity, int set_new_bits)
445{ 445{
446 struct drbd_bitmap *b = mdev->bitmap; 446 struct drbd_bitmap *b = mdev->bitmap;
447 unsigned long bits, words, owords, obits, *p_addr, *bm; 447 unsigned long bits, words, owords, obits, *p_addr, *bm;
@@ -526,8 +526,12 @@ int drbd_bm_resize(struct drbd_conf *mdev, sector_t capacity)
526 b->bm_dev_capacity = capacity; 526 b->bm_dev_capacity = capacity;
527 527
528 if (growing) { 528 if (growing) {
529 bm_memset(b, owords, 0xff, words-owords); 529 if (set_new_bits) {
530 b->bm_set += bits - obits; 530 bm_memset(b, owords, 0xff, words-owords);
531 b->bm_set += bits - obits;
532 } else
533 bm_memset(b, owords, 0x00, words-owords);
534
531 } 535 }
532 536
533 if (want < have) { 537 if (want < have) {