Lines Matching refs:primes
9 struct primes { struct
12 unsigned long primes[]; member
16 static const struct primes small_primes = {
19 .primes = {
41 static const struct primes small_primes = {
44 .primes = {
63 static const struct primes __rcu *primes = RCU_INITIALIZER(&small_primes); variable
109 const struct primes *p; in expand_to_next_prime()
110 struct primes *new; in expand_to_next_prime()
132 p = rcu_dereference_protected(primes, lockdep_is_held(&lock)); in expand_to_next_prime()
142 bitmap_fill(new->primes, sz); in expand_to_next_prime()
143 bitmap_copy(new->primes, p->primes, p->sz); in expand_to_next_prime()
144 for (y = 2UL; y < sz; y = find_next_bit(new->primes, sz, y + 1)) in expand_to_next_prime()
145 new->last = clear_multiples(y, new->primes, p->sz, sz); in expand_to_next_prime()
150 rcu_assign_pointer(primes, new); in expand_to_next_prime()
152 kfree_rcu((struct primes *)p, rcu); in expand_to_next_prime()
161 const struct primes *p; in free_primes()
164 p = rcu_dereference_protected(primes, lockdep_is_held(&lock)); in free_primes()
166 rcu_assign_pointer(primes, &small_primes); in free_primes()
167 kfree_rcu((struct primes *)p, rcu); in free_primes()
188 const struct primes *p; in next_prime_number()
191 p = rcu_dereference(primes); in next_prime_number()
199 p = rcu_dereference(primes); in next_prime_number()
201 x = find_next_bit(p->primes, p->last, x + 1); in next_prime_number()
221 const struct primes *p; in is_prime_number()
225 p = rcu_dereference(primes); in is_prime_number()
233 p = rcu_dereference(primes); in is_prime_number()
235 result = test_bit(x, p->primes); in is_prime_number()
244 const struct primes *p; in dump_primes()
250 p = rcu_dereference(primes); in dump_primes()
253 bitmap_print_to_pagebuf(true, buf, p->primes, p->sz); in dump_primes()
255 p->last, p->sz, p->primes[BITS_TO_LONGS(p->sz) - 1], buf); in dump_primes()