函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\math\prime_numbers.c Create Date:2022-07-27 07:40:59
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:expand_to_next_prime

函数原型:static bool expand_to_next_prime(unsigned long x)

返回类型:bool

参数:

类型参数名称
unsigned longx
123  sz等于2乘x
124  如果sz小于x则返回:false
127  sz等于und_up - round up to next specified power of 2*@x: the value to round*@y: multiple to round up to (must be a power of 2)* Rounds @x up to next multiple of @y (which must be a power of 2).* To perform arbitrary rounding up, use roundup() below.(sz, BITS_PER_LONG)
128  new等于kmalloc(new的长度 + bitmap_size(sz), GFP_KERNEL | DOC: Action modifiers* Action modifiers* ~~~~~~~~~~~~~~~~* %__GFP_NOWARN suppresses allocation failure reports.* %__GFP_COMP address compound page metadata.* %__GFP_ZERO returns a zeroed page on success.)
130  如果非new则返回:false
133  mutex_lock( & lock)
134  p等于cu_dereference_protected() - fetch RCU pointer when updates prevented*@p: The pointer to read, prior to dereferencing*@c: The conditions under which the dereference will take place* Return the value of the specified RCU-protected pointer, but omit(primes, lockdep_is_held( & lock))
135  如果x小于last
136  kfree(new)
137  转到:unlock
144  bitmap_fill(primes, sz)
145  bitmap_copy(primes, primes, sz)
146 y小于sz循环last等于clear_multiples(y, primes, sz, sz)
148  sz等于sz
150  BUG_ON(last <= x)
152  cu_assign_pointer() - assign to RCU-protected pointer*@p: pointer to assign to*@v: value to assign (publish)* Assigns the specified value to the specified RCU-protected* pointer, ensuring that any concurrent RCU readers will see* any prior initialization(primes, new)
153  如果p不等于small_primeskfree_rcu() - kfree an object after a grace period((structprimes * )p, rcu)
156  unlock :
157  mutex_unlock( & lock)
158  返回:true
调用者
名称描述
next_prime_numberxt_prime_number - return the next prime number*@x: the starting point for searching to test* A prime number is an integer greater than 1 that is only divisible by* itself and 1
is_prime_numbers_prime_number - test whether the given number is prime*@x: the number to test* A prime number is an integer greater than 1 that is only divisible by* itself and 1