diff options
author | NeilBrown <neilb@cse.unsw.edu.au> | 2005-06-21 20:17:13 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-06-21 22:07:43 -0400 |
commit | 57afd89f98a990747445f01c458ecae64263b2f8 (patch) | |
tree | cab9f5941f32299bc97936e111f6552ebcee9cf6 /drivers/md/raid6main.c | |
parent | 06d91a5fe0b50c9060e70bdf7786f8a3c66249db (diff) |
[PATCH] md: improve the interface to sync_request
1/ change the return value (which is number-of-sectors synced)
from 'int' to 'sector_t'.
The number of sectors is usually easily small enough to fit
in an int, but if resync needs to abort, it may want to return
the total number of remaining sectors, which could be large.
Also errors cannot be returned as negative numbers now, so use
0 instead
2/ Add a 'skipped' return parameter to allow the array to report
that it skipped the sectors. This allows md to take this into account
in the speed calculations.
Currently there is no important skipping, but the bitmap-based-resync
that is coming will use this.
Signed-off-by: Neil Brown <neilb@cse.unsw.edu.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/md/raid6main.c')
-rw-r--r-- | drivers/md/raid6main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/md/raid6main.c b/drivers/md/raid6main.c index fede16c4e8f3..d9c385496dc5 100644 --- a/drivers/md/raid6main.c +++ b/drivers/md/raid6main.c | |||
@@ -1636,7 +1636,7 @@ static int make_request (request_queue_t *q, struct bio * bi) | |||
1636 | } | 1636 | } |
1637 | 1637 | ||
1638 | /* FIXME go_faster isn't used */ | 1638 | /* FIXME go_faster isn't used */ |
1639 | static int sync_request (mddev_t *mddev, sector_t sector_nr, int go_faster) | 1639 | static sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *skipped, int go_faster) |
1640 | { | 1640 | { |
1641 | raid6_conf_t *conf = (raid6_conf_t *) mddev->private; | 1641 | raid6_conf_t *conf = (raid6_conf_t *) mddev->private; |
1642 | struct stripe_head *sh; | 1642 | struct stripe_head *sh; |
@@ -1659,8 +1659,8 @@ static int sync_request (mddev_t *mddev, sector_t sector_nr, int go_faster) | |||
1659 | * nothing we can do. | 1659 | * nothing we can do. |
1660 | */ | 1660 | */ |
1661 | if (mddev->degraded >= 2 && test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { | 1661 | if (mddev->degraded >= 2 && test_bit(MD_RECOVERY_SYNC, &mddev->recovery)) { |
1662 | int rv = (mddev->size << 1) - sector_nr; | 1662 | sector_t rv = (mddev->size << 1) - sector_nr; |
1663 | md_done_sync(mddev, rv, 1); | 1663 | *skipped = 1; |
1664 | return rv; | 1664 | return rv; |
1665 | } | 1665 | } |
1666 | 1666 | ||