summaryrefslogtreecommitdiff
path: root/drivers/md
diff options
context:
space:
mode:
authorHeinz Mauelshagen <heinzm@redhat.com>2017-12-13 19:13:20 +0300
committerMike Snitzer <snitzer@redhat.com>2017-12-13 19:59:21 +0300
commit7c29744eccecc2c74c9b4d1ea0a60b4d95229399 (patch)
tree337638ef9c113d7b6b9a3d63ea9afa21d70faa7f /drivers/md
parentdc15b943d4651bc13b9737bb27283ad9d3b8eeba (diff)
downloadlinux-7c29744eccecc2c74c9b4d1ea0a60b4d95229399.tar.xz
dm raid: simplify rs_get_progress()
No need to calculate the reshaping progress because mddev->curr_resync_completed holds it. Signed-off-by: Heinz Mauelshagen <heinzm@redhat.com> Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-raid.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/drivers/md/dm-raid.c b/drivers/md/dm-raid.c
index af4f40de2c0b..21e007c89c2e 100644
--- a/drivers/md/dm-raid.c
+++ b/drivers/md/dm-raid.c
@@ -3399,26 +3399,9 @@ static sector_t rs_get_progress(struct raid_set *rs, unsigned long recovery,
set_bit(RT_FLAG_RS_IN_SYNC, &rs->runtime_flags);
} else {
- /* Reshape is relative to the array size */
- if (test_bit(MD_RECOVERY_RESHAPE, &recovery)) {
- r = mddev->reshape_position;
- if (r != MaxSector) {
- /* Got to reverse on backward reshape */
- if (mddev->reshape_backwards)
- r = mddev->array_sectors - r;
-
- /* Divide by # of data stripes unless raid1 */
- if (!rs_is_raid1(rs))
- sector_div(r, mddev_data_stripes(rs));
- }
-
- /*
- * Sync/recover is relative to the component device size.
- *
- * MD_RECOVERY_NEEDED for https://bugzilla.redhat.com/show_bug.cgi?id=1508070
- */
- } else if (test_bit(MD_RECOVERY_NEEDED, &recovery) ||
- test_bit(MD_RECOVERY_RUNNING, &recovery))
+ if (test_bit(MD_RECOVERY_NEEDED, &recovery) ||
+ test_bit(MD_RECOVERY_RESHAPE, &recovery) ||
+ test_bit(MD_RECOVERY_RUNNING, &recovery))
r = mddev->curr_resync_completed;
else
r = mddev->recovery_cp;