Lines Matching refs:nbytes

493 			    int nbytes)  in _mix_pool_bytes()  argument
511 while (nbytes--) { in _mix_pool_bytes()
540 int nbytes) in __mix_pool_bytes() argument
542 trace_mix_pool_bytes_nolock(r->name, nbytes, _RET_IP_); in __mix_pool_bytes()
543 _mix_pool_bytes(r, in, nbytes); in __mix_pool_bytes()
547 int nbytes) in mix_pool_bytes() argument
551 trace_mix_pool_bytes(r->name, nbytes, _RET_IP_); in mix_pool_bytes()
553 _mix_pool_bytes(r, in, nbytes); in mix_pool_bytes()
968 size_t nbytes, int min, int rsvd);
975 static void _xfer_secondary_pool(struct entropy_store *r, size_t nbytes);
976 static void xfer_secondary_pool(struct entropy_store *r, size_t nbytes) in xfer_secondary_pool() argument
979 r->entropy_count >= (nbytes << (ENTROPY_SHIFT + 3)) || in xfer_secondary_pool()
992 _xfer_secondary_pool(r, nbytes); in xfer_secondary_pool()
995 static void _xfer_secondary_pool(struct entropy_store *r, size_t nbytes) in _xfer_secondary_pool() argument
1001 int bytes = nbytes; in _xfer_secondary_pool()
1008 trace_xfer_secondary_pool(r->name, bytes * 8, nbytes * 8, in _xfer_secondary_pool()
1036 static size_t account(struct entropy_store *r, size_t nbytes, int min, in account() argument
1047 ibytes = nbytes; in account()
1154 size_t nbytes, int min, int reserved) in extract_entropy() argument
1176 trace_extract_entropy(r->name, nbytes, ENTROPY_BITS(r), _RET_IP_); in extract_entropy()
1177 xfer_secondary_pool(r, nbytes); in extract_entropy()
1178 nbytes = account(r, nbytes, min, reserved); in extract_entropy()
1180 while (nbytes) { in extract_entropy()
1190 i = min_t(int, nbytes, EXTRACT_SIZE); in extract_entropy()
1192 nbytes -= i; in extract_entropy()
1208 size_t nbytes) in extract_entropy_user() argument
1212 int large_request = (nbytes > 256); in extract_entropy_user()
1214 trace_extract_entropy_user(r->name, nbytes, ENTROPY_BITS(r), _RET_IP_); in extract_entropy_user()
1215 xfer_secondary_pool(r, nbytes); in extract_entropy_user()
1216 nbytes = account(r, nbytes, 0, 0); in extract_entropy_user()
1218 while (nbytes) { in extract_entropy_user()
1229 i = min_t(int, nbytes, EXTRACT_SIZE); in extract_entropy_user()
1235 nbytes -= i; in extract_entropy_user()
1253 void get_random_bytes(void *buf, int nbytes) in get_random_bytes() argument
1262 trace_get_random_bytes(nbytes, _RET_IP_); in get_random_bytes()
1263 extract_entropy(&nonblocking_pool, buf, nbytes, 0, 0); in get_random_bytes()
1335 void get_random_bytes_arch(void *buf, int nbytes) in get_random_bytes_arch() argument
1339 trace_get_random_bytes_arch(nbytes, _RET_IP_); in get_random_bytes_arch()
1340 while (nbytes) { in get_random_bytes_arch()
1342 int chunk = min(nbytes, (int)sizeof(unsigned long)); in get_random_bytes_arch()
1349 nbytes -= chunk; in get_random_bytes_arch()
1352 if (nbytes) in get_random_bytes_arch()
1353 extract_entropy(&nonblocking_pool, p, nbytes, 0, 0); in get_random_bytes_arch()
1421 _random_read(int nonblock, char __user *buf, size_t nbytes) in _random_read() argument
1425 if (nbytes == 0) in _random_read()
1428 nbytes = min_t(size_t, nbytes, SEC_XFER_SIZE); in _random_read()
1430 n = extract_entropy_user(&blocking_pool, buf, nbytes); in _random_read()
1433 trace_random_read(n*8, (nbytes-n)*8, in _random_read()
1452 random_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) in random_read() argument
1454 return _random_read(file->f_flags & O_NONBLOCK, buf, nbytes); in random_read()
1458 urandom_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) in urandom_read() argument
1467 nbytes = min_t(size_t, nbytes, INT_MAX >> (ENTROPY_SHIFT + 3)); in urandom_read()
1468 ret = extract_entropy_user(&nonblocking_pool, buf, nbytes); in urandom_read()
1470 trace_urandom_read(8 * nbytes, ENTROPY_BITS(&nonblocking_pool), in urandom_read()