@@ -519,7 +519,7 @@ struct entropy_store {
519
519
};
520
520
521
521
static ssize_t extract_entropy (struct entropy_store * r , void * buf ,
522
- size_t nbytes , int min , int rsvd );
522
+ size_t nbytes , int min );
523
523
static ssize_t _extract_entropy (struct entropy_store * r , void * buf ,
524
524
size_t nbytes );
525
525
@@ -989,7 +989,7 @@ static void crng_reseed(struct crng_state *crng, struct entropy_store *r)
989
989
} buf ;
990
990
991
991
if (r ) {
992
- num = extract_entropy (r , & buf , 32 , 16 , 0 );
992
+ num = extract_entropy (r , & buf , 32 , 16 );
993
993
if (num == 0 )
994
994
return ;
995
995
} else {
@@ -1327,8 +1327,7 @@ EXPORT_SYMBOL_GPL(add_disk_randomness);
1327
1327
* This function decides how many bytes to actually take from the
1328
1328
* given pool, and also debits the entropy count accordingly.
1329
1329
*/
1330
- static size_t account (struct entropy_store * r , size_t nbytes , int min ,
1331
- int reserved )
1330
+ static size_t account (struct entropy_store * r , size_t nbytes , int min )
1332
1331
{
1333
1332
int entropy_count , orig , have_bytes ;
1334
1333
size_t ibytes , nfrac ;
@@ -1342,7 +1341,7 @@ static size_t account(struct entropy_store *r, size_t nbytes, int min,
1342
1341
/* never pull more than available */
1343
1342
have_bytes = entropy_count >> (ENTROPY_SHIFT + 3 );
1344
1343
1345
- if (( have_bytes -= reserved ) < 0 )
1344
+ if (have_bytes < 0 )
1346
1345
have_bytes = 0 ;
1347
1346
ibytes = min_t (size_t , ibytes , have_bytes );
1348
1347
if (ibytes < min )
@@ -1448,15 +1447,13 @@ static ssize_t _extract_entropy(struct entropy_store *r, void *buf,
1448
1447
* returns it in a buffer.
1449
1448
*
1450
1449
* The min parameter specifies the minimum amount we can pull before
1451
- * failing to avoid races that defeat catastrophic reseeding while the
1452
- * reserved parameter indicates how much entropy we must leave in the
1453
- * pool after each pull to avoid starving other readers.
1450
+ * failing to avoid races that defeat catastrophic reseeding.
1454
1451
*/
1455
1452
static ssize_t extract_entropy (struct entropy_store * r , void * buf ,
1456
- size_t nbytes , int min , int reserved )
1453
+ size_t nbytes , int min )
1457
1454
{
1458
1455
trace_extract_entropy (r -> name , nbytes , ENTROPY_BITS (r ), _RET_IP_ );
1459
- nbytes = account (r , nbytes , min , reserved );
1456
+ nbytes = account (r , nbytes , min );
1460
1457
return _extract_entropy (r , buf , nbytes );
1461
1458
}
1462
1459
0 commit comments