From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753845AbbERNHY (ORCPT ); Mon, 18 May 2015 09:07:24 -0400 Received: from mail.eperm.de ([89.247.134.16]:34818 "EHLO mail.eperm.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753820AbbERNHO (ORCPT ); Mon, 18 May 2015 09:07:14 -0400 From: Stephan Mueller To: Herbert Xu Cc: pebolle@tiscali.nl, andreas.steffen@strongswan.org, tytso@mit.edu, sandyinchina@gmail.com, linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org Subject: Re: [PATCH v6 1/5] random: Blocking API for accessing nonblocking_pool Date: Mon, 18 May 2015 15:07:10 +0200 Message-ID: <7743005.ngVOaoViLi@tauon> User-Agent: KMail/4.14.6 (Linux/3.19.5-200.fc21.x86_64; KDE/4.14.6; x86_64; ; ) In-Reply-To: <20150518092131.GA18659@gondor.apana.org.au> References: <1921857.OvxEu6y28S@tachyon.chronox.de> <3672239.xqA2RrDaZY@tachyon.chronox.de> <20150518092131.GA18659@gondor.apana.org.au> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Montag, 18. Mai 2015, 17:21:31 schrieb Herbert Xu: Hi Herbert, >> +/* >> + * 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. >> + 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