diff options
author | Philipp Reisner <philipp.reisner@linbit.com> | 2011-01-18 09:28:59 -0500 |
---|---|---|
committer | Philipp Reisner <philipp.reisner@linbit.com> | 2011-03-10 05:47:42 -0500 |
commit | 20ee639024e3d33111df0e343050b218c656bf16 (patch) | |
tree | bb19ee90dfbea96d0e11c1bd4c0dc0655638001c /drivers/block/drbd | |
parent | 6a35c45f890dc18c5527ac501b308058118f20e7 (diff) |
drbd: cleaned up __set_current_state() followed by schedule_timeout() calls
Signed-off-by: Philipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: Lars Ellenberg <lars.ellenberg@linbit.com>
Diffstat (limited to 'drivers/block/drbd')
-rw-r--r-- | drivers/block/drbd/drbd_nl.c | 3 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_receiver.c | 9 | ||||
-rw-r--r-- | drivers/block/drbd/drbd_worker.c | 3 |
3 files changed, 5 insertions, 10 deletions
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index a46bc0287e21..42e16e4edfa3 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -360,8 +360,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) | |||
360 | if (rv == SS_TWO_PRIMARIES) { | 360 | if (rv == SS_TWO_PRIMARIES) { |
361 | /* Maybe the peer is detected as dead very soon... | 361 | /* Maybe the peer is detected as dead very soon... |
362 | retry at most once more in this case. */ | 362 | retry at most once more in this case. */ |
363 | __set_current_state(TASK_INTERRUPTIBLE); | 363 | schedule_timeout_interruptible((mdev->net_conf->ping_timeo+1)*HZ/10); |
364 | schedule_timeout((mdev->net_conf->ping_timeo+1)*HZ/10); | ||
365 | if (try < max_tries) | 364 | if (try < max_tries) |
366 | try = max_tries - 1; | 365 | try = max_tries - 1; |
367 | continue; | 366 | continue; |
diff --git a/drivers/block/drbd/drbd_receiver.c b/drivers/block/drbd/drbd_receiver.c index a7f5b6d134e3..3ccc6c33a330 100644 --- a/drivers/block/drbd/drbd_receiver.c +++ b/drivers/block/drbd/drbd_receiver.c | |||
@@ -768,8 +768,7 @@ static int drbd_connect(struct drbd_conf *mdev) | |||
768 | if (s || ++try >= 3) | 768 | if (s || ++try >= 3) |
769 | break; | 769 | break; |
770 | /* give the other side time to call bind() & listen() */ | 770 | /* give the other side time to call bind() & listen() */ |
771 | __set_current_state(TASK_INTERRUPTIBLE); | 771 | schedule_timeout_interruptible(HZ / 10); |
772 | schedule_timeout(HZ / 10); | ||
773 | } | 772 | } |
774 | 773 | ||
775 | if (s) { | 774 | if (s) { |
@@ -788,8 +787,7 @@ static int drbd_connect(struct drbd_conf *mdev) | |||
788 | } | 787 | } |
789 | 788 | ||
790 | if (sock && msock) { | 789 | if (sock && msock) { |
791 | __set_current_state(TASK_INTERRUPTIBLE); | 790 | schedule_timeout_interruptible(HZ / 10); |
792 | schedule_timeout(HZ / 10); | ||
793 | ok = drbd_socket_okay(mdev, &sock); | 791 | ok = drbd_socket_okay(mdev, &sock); |
794 | ok = drbd_socket_okay(mdev, &msock) && ok; | 792 | ok = drbd_socket_okay(mdev, &msock) && ok; |
795 | if (ok) | 793 | if (ok) |
@@ -4142,8 +4140,7 @@ int drbdd_init(struct drbd_thread *thi) | |||
4142 | h = drbd_connect(mdev); | 4140 | h = drbd_connect(mdev); |
4143 | if (h == 0) { | 4141 | if (h == 0) { |
4144 | drbd_disconnect(mdev); | 4142 | drbd_disconnect(mdev); |
4145 | __set_current_state(TASK_INTERRUPTIBLE); | 4143 | schedule_timeout_interruptible(HZ); |
4146 | schedule_timeout(HZ); | ||
4147 | } | 4144 | } |
4148 | if (h == -1) { | 4145 | if (h == -1) { |
4149 | dev_warn(DEV, "Discarding network configuration.\n"); | 4146 | dev_warn(DEV, "Discarding network configuration.\n"); |
diff --git a/drivers/block/drbd/drbd_worker.c b/drivers/block/drbd/drbd_worker.c index 3a95b701b5d0..7b3d4dc4af84 100644 --- a/drivers/block/drbd/drbd_worker.c +++ b/drivers/block/drbd/drbd_worker.c | |||
@@ -777,8 +777,7 @@ int drbd_resync_finished(struct drbd_conf *mdev) | |||
777 | * queue (or even the read operations for those packets | 777 | * queue (or even the read operations for those packets |
778 | * is not finished by now). Retry in 100ms. */ | 778 | * is not finished by now). Retry in 100ms. */ |
779 | 779 | ||
780 | __set_current_state(TASK_INTERRUPTIBLE); | 780 | schedule_timeout_interruptible(HZ / 10); |
781 | schedule_timeout(HZ / 10); | ||
782 | w = kmalloc(sizeof(struct drbd_work), GFP_ATOMIC); | 781 | w = kmalloc(sizeof(struct drbd_work), GFP_ATOMIC); |
783 | if (w) { | 782 | if (w) { |
784 | w->cb = w_resync_finished; | 783 | w->cb = w_resync_finished; |