Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61775
b: refs/heads/master
c: 5a021e9
h: refs/heads/master
i:
  61773: b24bf6c
  61771: 4f35dd7
  61767: ce25915
  61759: 6530012
v: v3
  • Loading branch information
Matt Mackall authored and Linus Torvalds committed Jul 19, 2007
1 parent 11e612a commit df97dfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f745bb1c73e2395e6b9961d4d915a8f8e2cd32cd
refs/heads/master: 5a021e9ffd56c22700133ebc37d607f95be8f7bd
9 changes: 7 additions & 2 deletions trunk/drivers/char/random.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,9 +693,14 @@ static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes)

if (r->pull && r->entropy_count < nbytes * 8 &&
r->entropy_count < r->poolinfo->POOLBITS) {
int bytes = max_t(int, random_read_wakeup_thresh / 8,
min_t(int, nbytes, sizeof(tmp)));
/* If we're limited, always leave two wakeup worth's BITS */
int rsvd = r->limit ? 0 : random_read_wakeup_thresh/4;
int bytes = nbytes;

/* pull at least as many as BYTES as wakeup BITS */
bytes = max_t(int, bytes, random_read_wakeup_thresh / 8);
/* but never more than the buffer size */
bytes = min_t(int, bytes, sizeof(tmp));

DEBUG_ENT("going to reseed %s with %d bits "
"(%d of %d requested)\n",
Expand Down

0 comments on commit df97dfb

Please sign in to comment.