diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-11-05 05:05:47 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:19:03 -0500 |
commit | 2649f0809f55e4df98c333a2b85c6fc8fee04804 (patch) | |
tree | b275b9af4122fe84965d754b27615c71c8a13a60 /drivers/block/drbd/drbd_receiver.c | |
parent | e65f440d474d7d6a6fd8a2c844e851d8c96ed9c5 (diff) |
drbd: use the resync controller for online-verify requests as well
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd/drbd_receiver.c')
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index 10db70a23376..1c56af03c38b 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -1883,8 +1883,12 @@ int drbd_rs_should_slow_down(struct drbd_conf *mdev) | |||
1883 | 1883 | ||
1884 | /* sync speed average over the last 2*DRBD_SYNC_MARK_STEP, | 1884 | /* sync speed average over the last 2*DRBD_SYNC_MARK_STEP, |
1885 | * approx. */ | 1885 | * approx. */ |
1886 | i = (mdev->rs_last_mark + DRBD_SYNC_MARKS-2) % DRBD_SYNC_MARKS; | 1886 | i = (mdev->rs_last_mark + DRBD_SYNC_MARKS-1) % DRBD_SYNC_MARKS; |
1887 | rs_left = drbd_bm_total_weight(mdev) - mdev->rs_failed; | 1887 | |
1888 | if (mdev->state.conn == C_VERIFY_S || mdev->state.conn == C_VERIFY_T) | ||
1889 | rs_left = mdev->ov_left; | ||
1890 | else | ||
1891 | rs_left = drbd_bm_total_weight(mdev) - mdev->rs_failed; | ||
1888 | 1892 | ||
1889 | dt = ((long)jiffies - (long)mdev->rs_mark_time[i]) / HZ; | 1893 | dt = ((long)jiffies - (long)mdev->rs_mark_time[i]) / HZ; |
1890 | if (!dt) | 1894 | if (!dt) |
@@ -1992,6 +1996,8 @@ static int receive_DataRequest(struct drbd_conf *mdev, enum drbd_packets cmd, un | |||
1992 | D_ASSERT(mdev->agreed_pro_version >= 89); | 1996 | D_ASSERT(mdev->agreed_pro_version >= 89); |
1993 | e->w.cb = w_e_end_csum_rs_req; | 1997 | e->w.cb = w_e_end_csum_rs_req; |
1994 | } else if (cmd == P_OV_REPLY) { | 1998 | } else if (cmd == P_OV_REPLY) { |
1999 | /* track progress, we may need to throttle */ | ||
2000 | atomic_add(size >> 9, &mdev->rs_sect_in); | ||
1995 | e->w.cb = w_e_end_ov_reply; | 2001 | e->w.cb = w_e_end_ov_reply; |
1996 | dec_rs_pending(mdev); | 2002 | dec_rs_pending(mdev); |
1997 | /* drbd_rs_begin_io done when we sent this request, | 2003 | /* drbd_rs_begin_io done when we sent this request, |