aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2008-02-06 04:39:50 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-06 13:41:18 -0500
commitb47490c9bc73d0b34e4c194db40de183e592e446 (patch)
tree8334581aff7aa0b199df04c6f9d707c1902ad14f /include
parent66c811e99322767bad5db4368de93aac604f02a2 (diff)
md: Update md bitmap during resync.
Currently an md array with a write-intent bitmap does not updated that bitmap to reflect successful partial resync. Rather the entire bitmap is updated when the resync completes. This is because there is no guarentee that resync requests will complete in order, and tracking each request individually is unnecessarily burdensome. However there is value in regularly updating the bitmap, so add code to periodically pause while all pending sync requests complete, then update the bitmap. Doing this only every few seconds (the same as the bitmap update time) does not notciably affect resync performance. [snitzer@gmail.com: export bitmap_cond_end_sync] Signed-off-by: Neil Brown <neilb@suse.de> Cc: "Mike Snitzer" <snitzer@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/raid/bitmap.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index 306a1d1a5af..e51b531cd0b 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -244,6 +244,8 @@ struct bitmap {
244 */ 244 */
245 unsigned long daemon_lastrun; /* jiffies of last run */ 245 unsigned long daemon_lastrun; /* jiffies of last run */
246 unsigned long daemon_sleep; /* how many seconds between updates? */ 246 unsigned long daemon_sleep; /* how many seconds between updates? */
247 unsigned long last_end_sync; /* when we lasted called end_sync to
248 * update bitmap with resync progress */
247 249
248 atomic_t pending_writes; /* pending writes to the bitmap file */ 250 atomic_t pending_writes; /* pending writes to the bitmap file */
249 wait_queue_head_t write_wait; 251 wait_queue_head_t write_wait;
@@ -275,6 +277,7 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset,
275int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded); 277int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int degraded);
276void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); 278void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
277void bitmap_close_sync(struct bitmap *bitmap); 279void bitmap_close_sync(struct bitmap *bitmap);
280void bitmap_cond_end_sync(struct bitmap *bitmap, sector_t sector);
278 281
279void bitmap_unplug(struct bitmap *bitmap); 282void bitmap_unplug(struct bitmap *bitmap);
280void bitmap_daemon_work(struct bitmap *bitmap); 283void bitmap_daemon_work(struct bitmap *bitmap);