Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -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 @@ static int conn_connect(struct drbd_tconn *tconn)
				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;
			}
			}
		}
		}