diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-02-07 05:33:59 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-09-28 04:26:46 -0400 |
commit | 1f04af33fe7db542d75a487b8381b5a3402b7896 (patch) | |
tree | 5d00b3f6a1d39ae9877f9d33a6d530f936e8e6fb /drivers/block/drbd/drbd_worker.c | |
parent | bc31fe3352f9cd76195ce6eb638dfc2dac17dc2e (diff) |
drbd: Moved code
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 | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 0dbd20ca6306..28925d3d1a2f 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -707,28 +707,6 @@ static int w_make_ov_request(struct drbd_conf *mdev, struct drbd_work *w, int ca | |||
707 | return 1; | 707 | return 1; |
708 | } | 708 | } |
709 | 709 | ||
710 | |||
711 | void start_resync_timer_fn(unsigned long data) | ||
712 | { | ||
713 | struct drbd_conf *mdev = (struct drbd_conf *) data; | ||
714 | |||
715 | drbd_queue_work(&mdev->tconn->data.work, &mdev->start_resync_work); | ||
716 | } | ||
717 | |||
718 | int w_start_resync(struct drbd_conf *mdev, struct drbd_work *w, int cancel) | ||
719 | { | ||
720 | if (atomic_read(&mdev->unacked_cnt) || atomic_read(&mdev->rs_pending_cnt)) { | ||
721 | dev_warn(DEV, "w_start_resync later...\n"); | ||
722 | mdev->start_resync_timer.expires = jiffies + HZ/10; | ||
723 | add_timer(&mdev->start_resync_timer); | ||
724 | return 1; | ||
725 | } | ||
726 | |||
727 | drbd_start_resync(mdev, C_SYNC_SOURCE); | ||
728 | clear_bit(AHEAD_TO_SYNC_SOURCE, &mdev->current_epoch->flags); | ||
729 | return 1; | ||
730 | } | ||
731 | |||
732 | int w_ov_finished(struct drbd_conf *mdev, struct drbd_work *w, int cancel) | 710 | int w_ov_finished(struct drbd_conf *mdev, struct drbd_work *w, int cancel) |
733 | { | 711 | { |
734 | kfree(w); | 712 | kfree(w); |
@@ -1462,6 +1440,27 @@ void drbd_rs_controller_reset(struct drbd_conf *mdev) | |||
1462 | spin_unlock(&mdev->peer_seq_lock); | 1440 | spin_unlock(&mdev->peer_seq_lock); |
1463 | } | 1441 | } |
1464 | 1442 | ||
1443 | void start_resync_timer_fn(unsigned long data) | ||
1444 | { | ||
1445 | struct drbd_conf *mdev = (struct drbd_conf *) data; | ||
1446 | |||
1447 | drbd_queue_work(&mdev->tconn->data.work, &mdev->start_resync_work); | ||
1448 | } | ||
1449 | |||
1450 | int w_start_resync(struct drbd_conf *mdev, struct drbd_work *w, int cancel) | ||
1451 | { | ||
1452 | if (atomic_read(&mdev->unacked_cnt) || atomic_read(&mdev->rs_pending_cnt)) { | ||
1453 | dev_warn(DEV, "w_start_resync later...\n"); | ||
1454 | mdev->start_resync_timer.expires = jiffies + HZ/10; | ||
1455 | add_timer(&mdev->start_resync_timer); | ||
1456 | return 1; | ||
1457 | } | ||
1458 | |||
1459 | drbd_start_resync(mdev, C_SYNC_SOURCE); | ||
1460 | clear_bit(AHEAD_TO_SYNC_SOURCE, &mdev->current_epoch->flags); | ||
1461 | return 1; | ||
1462 | } | ||
1463 | |||
1465 | /** | 1464 | /** |
1466 | * drbd_start_resync() - Start the resync process | 1465 | * drbd_start_resync() - Start the resync process |
1467 | * @mdev: DRBD device. | 1466 | * @mdev: DRBD device. |