aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bitmap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bitmap.c')
-rw-r--r--drivers/md/bitmap.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
index 431da21cb488..ac93d874578a 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1597,6 +1597,27 @@ void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector, bool force)
1597} 1597}
1598EXPORT_SYMBOL(bitmap_cond_end_sync); 1598EXPORT_SYMBOL(bitmap_cond_end_sync);
1599 1599
1600void bitmap_sync_with_cluster(struct mddev *mddev,
1601 sector_t old_lo, sector_t old_hi,
1602 sector_t new_lo, sector_t new_hi)
1603{
1604 struct bitmap *bitmap = mddev->bitmap;
1605 sector_t sector, blocks = 0;
1606
1607 for (sector = old_lo; sector < new_lo; ) {
1608 bitmap_end_sync(bitmap, sector, &blocks, 0);
1609 sector += blocks;
1610 }
1611 WARN((blocks > new_lo) && old_lo, "alignment is not correct for lo\n");
1612
1613 for (sector = old_hi; sector < new_hi; ) {
1614 bitmap_start_sync(bitmap, sector, &blocks, 0);
1615 sector += blocks;
1616 }
1617 WARN((blocks > new_hi) && old_hi, "alignment is not correct for hi\n");
1618}
1619EXPORT_SYMBOL(bitmap_sync_with_cluster);
1620
1600static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset, int needed) 1621static void bitmap_set_memory_bits(struct bitmap *bitmap, sector_t offset, int needed)
1601{ 1622{
1602 /* For each chunk covered by any of these sectors, set the 1623 /* For each chunk covered by any of these sectors, set the