Commit 38b682b2 authored by Akinobu Mita's avatar Akinobu Mita Committed by Linus Torvalds

drbd: rename random32() to prandom_u32()

Use preferable function name which implies using a pseudo-random
number generator.
Signed-off-by: default avatarAkinobu Mita <akinobu.mita@gmail.com>
Cc: Jens Axboe <axboe@kernel.dk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 6d65df33
......@@ -757,7 +757,8 @@ static struct socket *drbd_wait_for_connect(struct drbd_tconn *tconn, struct acc
rcu_read_unlock();
timeo = connect_int * HZ;
timeo += (random32() & 1) ? timeo / 7 : -timeo / 7; /* 28.5% random jitter */
/* 28.5% random jitter */
timeo += (prandom_u32() & 1) ? timeo / 7 : -timeo / 7;
err = wait_for_completion_interruptible_timeout(&ad->door_bell, timeo);
if (err <= 0)
......@@ -953,7 +954,7 @@ static int conn_connect(struct drbd_tconn *tconn)
conn_warn(tconn, "Error receiving initial packet\n");
sock_release(s);
randomize:
if (random32() & 1)
if (prandom_u32() & 1)
goto retry;
}
}
......
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