From: Matt Mackall Remove pool clearing. We've only ever cleared one of three pools and there's no good reason to do it. Instead just reset the entropy count. Signed-off-by: Matt Mackall Signed-off-by: Andrew Morton --- 25-akpm/drivers/char/random.c | 16 ++-------------- 1 files changed, 2 insertions(+), 14 deletions(-) diff -puN drivers/char/random.c~random-pt2-kill-pool-clearing drivers/char/random.c --- 25/drivers/char/random.c~random-pt2-kill-pool-clearing 2005-01-16 00:53:26.778937872 -0800 +++ 25-akpm/drivers/char/random.c 2005-01-16 00:53:26.785936808 -0800 @@ -546,15 +546,6 @@ static int create_entropy_store(int size return 0; } -/* Clear the entropy pool and associated counters. */ -static void clear_entropy_store(struct entropy_store *r) -{ - r->add_ptr = 0; - r->entropy_count = 0; - r->input_rotate = 0; - memset(r->pool, 0, r->poolinfo.POOLBYTES); -} - /* * This function adds a byte into the entropy "pool". It does not * update the entropy estimate. The caller should call @@ -1531,9 +1522,6 @@ static int __init rand_initialize(void) if (create_entropy_store(SECONDARY_POOL_SIZE, "urandom", &urandom_state)) goto err; - clear_entropy_store(random_state); - clear_entropy_store(sec_random_state); - clear_entropy_store(urandom_state); init_std_data(random_state); init_std_data(sec_random_state); init_std_data(urandom_state); @@ -1766,10 +1754,10 @@ random_ioctl(struct inode * inode, struc random_state->entropy_count = 0; return 0; case RNDCLEARPOOL: - /* Clear the entropy pool and associated counters. */ + /* Clear the entropy pool counters. */ if (!capable(CAP_SYS_ADMIN)) return -EPERM; - clear_entropy_store(random_state); + random_state->entropy_count = 0; init_std_data(random_state); return 0; default: _