mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2025-01-10 23:20:05 +00:00
drbd: rename random32() to prandom_u32()
Use preferable function name which implies using a pseudo-random number generator. Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com> Cc: Jens Axboe <axboe@kernel.dk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
6d65df3325
commit
38b682b261
@ -757,7 +757,8 @@ static struct socket *drbd_wait_for_connect(struct drbd_tconn *tconn, struct acc
|
|||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
|
||||||
timeo = connect_int * HZ;
|
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);
|
err = wait_for_completion_interruptible_timeout(&ad->door_bell, timeo);
|
||||||
if (err <= 0)
|
if (err <= 0)
|
||||||
@ -953,7 +954,7 @@ retry:
|
|||||||
conn_warn(tconn, "Error receiving initial packet\n");
|
conn_warn(tconn, "Error receiving initial packet\n");
|
||||||
sock_release(s);
|
sock_release(s);
|
||||||
randomize:
|
randomize:
|
||||||
if (random32() & 1)
|
if (prandom_u32() & 1)
|
||||||
goto retry;
|
goto retry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user