md: improve usefulness and accuracy of sysfs file md/sync_completed.
authorNeilBrown <neilb@suse.de>
Tue, 14 Apr 2009 06:28:34 +0000 (16:28 +1000)
committerNeilBrown <neilb@suse.de>
Tue, 14 Apr 2009 06:28:34 +0000 (16:28 +1000)
commitacb180b0e335ad88acfed6c8a33e39c05b95dc49
treefa980978bb66b178fd8c2f474194754139c0921d
parent6d56e278444bc8323b1bcfcada126b8e4dbba0f4
md: improve usefulness and accuracy of sysfs file md/sync_completed.

The sync_completed file reports how much of a resync (or recovery or
reshape) has been completed.
However due to the possibility of out-of-order completion of writes,
it is not certain to be accurate.

We have an internal value - mddev->curr_resync_completed - which is an
accurate value (though it might not always be quite so uptodate).

So:
 - make curr_resync_completed be uptodate a little more often,
   particularly when raid5 reshape updates status in the metadata
 - report curr_resync_completed in the sysfs file
 - allow poll/select to report all updates to md/sync_completed.

This makes sync_completed completed usable by any external metadata
handler that wants to record this status information in its metadata.

Signed-off-by: NeilBrown <neilb@suse.de>
drivers/md/bitmap.c
drivers/md/md.c
drivers/md/raid5.c