Re: [PATCH v4 3/6] hw_random: use reference counts on each struct hwrng.

2014-11-17 Thread Amos Kong
On Wed, Nov 12, 2014 at 02:11:23PM +1030, Rusty Russell wrote: > Amos Kong writes: > > From: Rusty Russell > > > > current_rng holds one reference, and we bump it every time we want > > to do a read from it. > > > > This means we only hold the rng_mutex to grab or drop a reference, > > so accessi

Re: [PATCH v4 3/6] hw_random: use reference counts on each struct hwrng.

2014-11-11 Thread Rusty Russell
Amos Kong writes: > From: Rusty Russell > > current_rng holds one reference, and we bump it every time we want > to do a read from it. > > This means we only hold the rng_mutex to grab or drop a reference, > so accessing /sys/devices/virtual/misc/hw_random/rng_current doesn't > block on read of /

[PATCH v4 3/6] hw_random: use reference counts on each struct hwrng.

2014-11-03 Thread Amos Kong
From: Rusty Russell current_rng holds one reference, and we bump it every time we want to do a read from it. This means we only hold the rng_mutex to grab or drop a reference, so accessing /sys/devices/virtual/misc/hw_random/rng_current doesn't block on read of /dev/hwrng. Using a kref is overk