Thread (26 messages) 26 messages, 3 authors, 2015-06-05

Re: [PATCH v6 1/5] random: Blocking API for accessing nonblocking_pool

From: Stephan Mueller <hidden>
Date: 2015-05-18 13:07:24
Also in: lkml

Am Montag, 18. Mai 2015, 17:21:31 schrieb Herbert Xu:

Hi Herbert,
quoted
+/*
+ * Equivalent function to get_random_bytes with the difference that this
+ * function blocks the request until the nonblocking_pool is initialized.
+ */
+int get_blocking_random_bytes_cb(void *buf, int nbytes, void *private,
+				 void (*cb)(void *buf, int buflen,
+					    void *private))
You can simplify this further and get rid of buf/nbytes.  All
we need to know is whether the pool is ready.  Everything else
can come from private.
So, the async function is now just a notification of the caller. Sounds good 
with me.
quoted
+	struct random_work *rw = NULL;
+	int ret = 0;
I think this function should return 0 if the pool is ready now,
-EINPROGRESS if it's not (indicating that the callback will be
called when it is ready) and otherwise an error.
Ok, will come in the next patch.

Ciao
Stephan
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help