函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:check_reserve

函数原型:static noinline void check_reserve(struct xarray *xa)

返回类型:void

参数:

类型参数名称
struct xarray *xa
405  XA_BUG_ON(xa, !xa_empty() - Determine if an array has any present entries.*@xa: XArray.* Context: Any context.* Return: %true if the array contains only NULL pointers.)
406  XA_BUG_ON(xa, xa_reserve() - Reserve this index in the XArray.*@xa: XArray.*@index: Index into array.*@gfp: Memory allocation flags.* Ensures there is somewhere to store an entry at @index in the array.* If there is already something stored at @index, this function does != 0)
407  XA_BUG_ON(xa, xa_empty() - Determine if an array has any present entries.*@xa: XArray.* Context: Any context.* Return: %true if the array contains only NULL pointers.)
408  XA_BUG_ON(xa, xa_load() - Load an entry from an XArray.*@xa: XArray.*@index: index into array.* Context: Any context. Takes and releases the RCU lock.* Return: The entry at @index in @xa.)
409  xa_release() - Release a reserved entry.*@xa: XArray.*@index: Index of entry.* After calling xa_reserve(), you can call this function to release the* reservation. If the entry at @index has been stored to, this function* will do nothing.
410  XA_BUG_ON(xa, !xa_empty() - Determine if an array has any present entries.*@xa: XArray.* Context: Any context.* Return: %true if the array contains only NULL pointers.)
413  XA_BUG_ON(xa, xa_reserve() - Reserve this index in the XArray.*@xa: XArray.*@index: Index into array.*@gfp: Memory allocation flags.* Ensures there is somewhere to store an entry at @index in the array.* If there is already something stored at @index, this function does != 0)
414  XA_BUG_ON(xa, xa_store_index(xa, 12345678, GFP_NOWAIT) != NULL)
415  xa_release() - Release a reserved entry.*@xa: XArray.*@index: Index of entry.* After calling xa_reserve(), you can call this function to release the* reservation. If the entry at @index has been stored to, this function* will do nothing.
416  xa_erase_index(xa, 12345678)
417  XA_BUG_ON(xa, !xa_empty() - Determine if an array has any present entries.*@xa: XArray.* Context: Any context.* Return: %true if the array contains only NULL pointers.)
420  XA_BUG_ON(xa, xa_reserve() - Reserve this index in the XArray.*@xa: XArray.*@index: Index into array.*@gfp: Memory allocation flags.* Ensures there is somewhere to store an entry at @index in the array.* If there is already something stored at @index, this function does != 0)
421  XA_BUG_ON(xa, xa_cmpxchg() - Conditionally replace an entry in the XArray.*@xa: XArray.*@index: Index into array.*@old: Old value to test against.*@entry: New value to place in array.*@gfp: Memory allocation flags. != NULL)
423  xa_release() - Release a reserved entry.*@xa: XArray.*@index: Index of entry.* After calling xa_reserve(), you can call this function to release the* reservation. If the entry at @index has been stored to, this function* will do nothing.
424  xa_erase_index(xa, 12345678)
425  XA_BUG_ON(xa, !xa_empty() - Determine if an array has any present entries.*@xa: XArray.* Context: Any context.* Return: %true if the array contains only NULL pointers.)
428  XA_BUG_ON(xa, xa_reserve() - Reserve this index in the XArray.*@xa: XArray.*@index: Index into array.*@gfp: Memory allocation flags.* Ensures there is somewhere to store an entry at @index in the array.* If there is already something stored at @index, this function does != 0)
429  XA_BUG_ON(xa, xa_insert() - Store this entry in the XArray unless another entry is* already present.*@xa: XArray.*@index: Index into array.*@entry: New entry.*@gfp: Memory allocation flags.* Inserting a NULL entry will store a reserved entry (like xa_reserve()) != - EBUSY)
431  XA_BUG_ON(xa, xa_empty() - Determine if an array has any present entries.*@xa: XArray.* Context: Any context.* Return: %true if the array contains only NULL pointers.)
432  XA_BUG_ON(xa, xa_erase() - Erase this entry from the XArray.*@xa: XArray.*@index: Index of entry.* After this function returns, loading from @index will return %NULL.* If the index is part of a multi-index entry, all indices will be erased != NULL)
433  XA_BUG_ON(xa, !xa_empty() - Determine if an array has any present entries.*@xa: XArray.* Context: Any context.* Return: %true if the array contains only NULL pointers.)
436  xa_store_index(xa, 5, GFP_KERNEL)
437  XA_BUG_ON(xa, xa_reserve() - Reserve this index in the XArray.*@xa: XArray.*@index: Index into array.*@gfp: Memory allocation flags.* Ensures there is somewhere to store an entry at @index in the array.* If there is already something stored at @index, this function does != 0)
438  xa_store_index(xa, 7, GFP_KERNEL)
440  count等于0
441  xa_for_each() - Iterate over present entries in an XArray.*@xa: XArray.*@index: Index of @entry.*@entry: Entry retrieved from array.* During the iteration, @entry will have the value of the entry stored* in @xa at @index(xa, index, entry)
442  XA_BUG_ON(xa, index != 5 && index != 7)
443  count自加
445  XA_BUG_ON(xa, count != 2)
448  如果private: The rest of the data structure is not to be used directly. 按位与ALLOC is for a normal 0-based alloc. ALLOC1 is for an 1-based alloc
451  XA_BUG_ON(xa, xa_alloc(xa, & id, xa_mk_value() - Create an XArray entry from an integer.*@v: Value to store in XArray.* Context: Any context.* Return: An entry suitable for storing in the XArray., XA_LIMIT(5, 10), GFP_KERNEL) != 0)
453  XA_BUG_ON(xa, id != 8)
455  xa_release() - Release a reserved entry.*@xa: XArray.*@index: Index of entry.* After calling xa_reserve(), you can call this function to release the* reservation. If the entry at @index has been stored to, this function* will do nothing.
456  XA_BUG_ON(xa, xa_alloc(xa, & id, xa_mk_value() - Create an XArray entry from an integer.*@v: Value to store in XArray.* Context: Any context.* Return: An entry suitable for storing in the XArray., XA_LIMIT(5, 10), GFP_KERNEL) != 0)
458  XA_BUG_ON(xa, id != 6)
461  xa_destroy() - Free all internal data structures.*@xa: XArray.* After calling this function, the XArray is empty and has freed all memory* allocated for its internal data structures. You are responsible for* freeing the objects referenced by the XArray.
调用者
名称描述
xarray_checks