diff options
author | Lars Ellenberg <lars.ellenberg@linbit.com> | 2010-11-05 04:55:18 -0400 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:18:59 -0500 |
commit | 9bd28d3c90c80c7ec46085de281b38f67331da41 (patch) | |
tree | 92bfb9ec78eaea619888811903ccc2512521c6de /drivers/block/drbd/drbd_worker.c | |
parent | 439d595379f87ec95249da21122eb085866f8ba9 (diff) |
drbd: factor out drbd_rs_controller_reset
Preparation patch to be able to use the auto-throttling 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_worker.c')
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index a050eb0d93ba..971e9b3b13ba 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -1439,6 +1439,17 @@ int drbd_alter_sa(struct drbd_conf *mdev, int na) | |||
1439 | return retcode; | 1439 | return retcode; |
1440 | } | 1440 | } |
1441 | 1441 | ||
1442 | void drbd_rs_controller_reset(struct drbd_conf *mdev) | ||
1443 | { | ||
1444 | atomic_set(&mdev->rs_sect_in, 0); | ||
1445 | atomic_set(&mdev->rs_sect_ev, 0); | ||
1446 | mdev->rs_in_flight = 0; | ||
1447 | mdev->rs_planed = 0; | ||
1448 | spin_lock(&mdev->peer_seq_lock); | ||
1449 | fifo_set(&mdev->rs_plan_s, 0); | ||
1450 | spin_unlock(&mdev->peer_seq_lock); | ||
1451 | } | ||
1452 | |||
1442 | /** | 1453 | /** |
1443 | * drbd_start_resync() - Start the resync process | 1454 | * drbd_start_resync() - Start the resync process |
1444 | * @mdev: DRBD device. | 1455 | * @mdev: DRBD device. |
@@ -1556,13 +1567,7 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) | |||
1556 | drbd_resync_finished(mdev); | 1567 | drbd_resync_finished(mdev); |
1557 | } | 1568 | } |
1558 | 1569 | ||
1559 | atomic_set(&mdev->rs_sect_in, 0); | 1570 | drbd_rs_controller_reset(mdev); |
1560 | atomic_set(&mdev->rs_sect_ev, 0); | ||
1561 | mdev->rs_in_flight = 0; | ||
1562 | mdev->rs_planed = 0; | ||
1563 | spin_lock(&mdev->peer_seq_lock); | ||
1564 | fifo_set(&mdev->rs_plan_s, 0); | ||
1565 | spin_unlock(&mdev->peer_seq_lock); | ||
1566 | /* ns.conn may already be != mdev->state.conn, | 1571 | /* ns.conn may already be != mdev->state.conn, |
1567 | * we may have been paused in between, or become paused until | 1572 | * we may have been paused in between, or become paused until |
1568 | * the timer triggers. | 1573 | * the timer triggers. |