Commit 20ee6390 authored by Philipp Reisner's avatar Philipp Reisner

drbd: cleaned up __set_current_state() followed by schedule_timeout() calls

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 6a35c45f
...@@ -360,8 +360,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force) ...@@ -360,8 +360,7 @@ drbd_set_role(struct drbd_conf *mdev, enum drbd_role new_role, int force)
if (rv == SS_TWO_PRIMARIES) { if (rv == SS_TWO_PRIMARIES) {
/* Maybe the peer is detected as dead very soon... /* Maybe the peer is detected as dead very soon...
retry at most once more in this case. */ retry at most once more in this case. */
__set_current_state(TASK_INTERRUPTIBLE); schedule_timeout_interruptible((mdev->net_conf->ping_timeo+1)*HZ/10);
schedule_timeout((mdev->net_conf->ping_timeo+1)*HZ/10);
if (try < max_tries) if (try < max_tries)
try = max_tries - 1; try = max_tries - 1;
continue; continue;
......
...@@ -768,8 +768,7 @@ static int drbd_connect(struct drbd_conf *mdev) ...@@ -768,8 +768,7 @@ static int drbd_connect(struct drbd_conf *mdev)
if (s || ++try >= 3) if (s || ++try >= 3)
break; break;
/* give the other side time to call bind() & listen() */ /* give the other side time to call bind() & listen() */
__set_current_state(TASK_INTERRUPTIBLE); schedule_timeout_interruptible(HZ / 10);
schedule_timeout(HZ / 10);
} }
if (s) { if (s) {
...@@ -788,8 +787,7 @@ static int drbd_connect(struct drbd_conf *mdev) ...@@ -788,8 +787,7 @@ static int drbd_connect(struct drbd_conf *mdev)
} }
if (sock && msock) { if (sock && msock) {
__set_current_state(TASK_INTERRUPTIBLE); schedule_timeout_interruptible(HZ / 10);
schedule_timeout(HZ / 10);
ok = drbd_socket_okay(mdev, &sock); ok = drbd_socket_okay(mdev, &sock);
ok = drbd_socket_okay(mdev, &msock) && ok; ok = drbd_socket_okay(mdev, &msock) && ok;
if (ok) if (ok)
...@@ -4142,8 +4140,7 @@ int drbdd_init(struct drbd_thread *thi) ...@@ -4142,8 +4140,7 @@ int drbdd_init(struct drbd_thread *thi)
h = drbd_connect(mdev); h = drbd_connect(mdev);
if (h == 0) { if (h == 0) {
drbd_disconnect(mdev); drbd_disconnect(mdev);
__set_current_state(TASK_INTERRUPTIBLE); schedule_timeout_interruptible(HZ);
schedule_timeout(HZ);
} }
if (h == -1) { if (h == -1) {
dev_warn(DEV, "Discarding network configuration.\n"); dev_warn(DEV, "Discarding network configuration.\n");
......
...@@ -777,8 +777,7 @@ int drbd_resync_finished(struct drbd_conf *mdev) ...@@ -777,8 +777,7 @@ int drbd_resync_finished(struct drbd_conf *mdev)
* queue (or even the read operations for those packets * queue (or even the read operations for those packets
* is not finished by now). Retry in 100ms. */ * is not finished by now). Retry in 100ms. */
__set_current_state(TASK_INTERRUPTIBLE); schedule_timeout_interruptible(HZ / 10);
schedule_timeout(HZ / 10);
w = kmalloc(sizeof(struct drbd_work), GFP_ATOMIC); w = kmalloc(sizeof(struct drbd_work), GFP_ATOMIC);
if (w) { if (w) {
w->cb = w_resync_finished; w->cb = w_resync_finished;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment