Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\test_xarray.c Create Date:2022-07-28 06:33:38
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:check_reserve

Proto:static noinline void check_reserve(struct xarray *xa)

Type:void

Parameter:

TypeParameterName
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  If 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 Then
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.
Caller
NameDescribe
xarray_checks