aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/raid/md_k.h
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2006-07-10 07:44:16 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-07-10 16:24:16 -0400
commitff4e8d9a9f46e3a7f89d14ade52fe5d53a82c022 (patch)
treee15fc4d8af0045a3947e3a25844773c6ee50289a /include/linux/raid/md_k.h
parent0b8c9de05c2a860fe6b02fedcb48763bcee648b3 (diff)
[PATCH] md: fix resync speed calculation for restarted resyncs
We introduced 'io_sectors' recently so we could count the sectors that causes io during resync separate from sectors which didn't cause IO - there can be a difference if a bitmap is being used to accelerate resync. However when a speed is reported, we find the number of sectors processed recently by subtracting an oldish io_sectors count from a current 'curr_resync' count. This is wrong because curr_resync counts all sectors, not just io sectors. So, add a field to mddev to store the curren io_sectors separately from curr_resync, and use that in the calculations. Signed-off-by: Neil Brown <neilb@suse.de> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/raid/md_k.h')
-rw-r--r--include/linux/raid/md_k.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index c1e0ac55bab5..d28890295852 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -148,9 +148,10 @@ struct mddev_s
148 148
149 struct mdk_thread_s *thread; /* management thread */ 149 struct mdk_thread_s *thread; /* management thread */
150 struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */ 150 struct mdk_thread_s *sync_thread; /* doing resync or reconstruct */
151 sector_t curr_resync; /* blocks scheduled */ 151 sector_t curr_resync; /* last block scheduled */
152 unsigned long resync_mark; /* a recent timestamp */ 152 unsigned long resync_mark; /* a recent timestamp */
153 sector_t resync_mark_cnt;/* blocks written at resync_mark */ 153 sector_t resync_mark_cnt;/* blocks written at resync_mark */
154 sector_t curr_mark_cnt; /* blocks scheduled now */
154 155
155 sector_t resync_max_sectors; /* may be set by personality */ 156 sector_t resync_max_sectors; /* may be set by personality */
156 157