[PATCH] md: fix resync speed calculation for restarted resyncs
authorNeilBrown <neilb@suse.de>
Mon, 10 Jul 2006 11:44:16 +0000 (04:44 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Mon, 10 Jul 2006 20:24:16 +0000 (13:24 -0700)
commitff4e8d9a9f46e3a7f89d14ade52fe5d53a82c022
treee15fc4d8af0045a3947e3a25844773c6ee50289a
parent0b8c9de05c2a860fe6b02fedcb48763bcee648b3
[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>
drivers/md/md.c
drivers/md/raid5.c
include/linux/raid/md_k.h