Lines Matching refs:primes

11 struct primes {  struct
14 unsigned long primes[]; argument
18 static const struct primes small_primes = {
21 .primes = {
43 static const struct primes small_primes = {
46 .primes = {
65 static const struct primes __rcu *primes = RCU_INITIALIZER(&small_primes); variable
111 const struct primes *p; in expand_to_next_prime()
112 struct primes *new; in expand_to_next_prime()
134 p = rcu_dereference_protected(primes, lockdep_is_held(&lock)); in expand_to_next_prime()
144 bitmap_fill(new->primes, sz); in expand_to_next_prime()
145 bitmap_copy(new->primes, p->primes, p->sz); in expand_to_next_prime()
146 for (y = 2UL; y < sz; y = find_next_bit(new->primes, sz, y + 1)) in expand_to_next_prime()
147 new->last = clear_multiples(y, new->primes, p->sz, sz); in expand_to_next_prime()
152 rcu_assign_pointer(primes, new); in expand_to_next_prime()
154 kfree_rcu((struct primes *)p, rcu); in expand_to_next_prime()
163 const struct primes *p; in free_primes()
166 p = rcu_dereference_protected(primes, lockdep_is_held(&lock)); in free_primes()
168 rcu_assign_pointer(primes, &small_primes); in free_primes()
169 kfree_rcu((struct primes *)p, rcu); in free_primes()
190 const struct primes *p; in next_prime_number()
193 p = rcu_dereference(primes); in next_prime_number()
201 p = rcu_dereference(primes); in next_prime_number()
203 x = find_next_bit(p->primes, p->last, x + 1); in next_prime_number()
223 const struct primes *p; in is_prime_number()
227 p = rcu_dereference(primes); in is_prime_number()
235 p = rcu_dereference(primes); in is_prime_number()
237 result = test_bit(x, p->primes); in is_prime_number()
246 const struct primes *p; in dump_primes()
252 p = rcu_dereference(primes); in dump_primes()
255 bitmap_print_to_pagebuf(true, buf, p->primes, p->sz); in dump_primes()
257 p->last, p->sz, p->primes[BITS_TO_LONGS(p->sz) - 1], buf); in dump_primes()