Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:da_free() - Release an allocated ID.*@ida: IDA handle.*@id: Previously allocated ID.* Context: Any context.

Proto:void ida_free(struct ida *ida, unsigned int id)

Type:void

Parameter:

TypeParameterName
struct ida *ida
unsigned intid
486  XA_STATE() - Declare an XArray operation state.*@name: Name of this operation state (usually xas).*@array: Array to operate on.*@index: Initial index of interest.* Declare and initialise an xa_state on the stack.(xas, & xa, id / IDA_BITMAP_BITS)
487  bit = id % IDA_BITMAP_BITS
491  BUG_ON((int)id < 0)
493  xas_lock_irqsave( & xas, flags)
494  bitmap = xas_load() - Load an entry from the XArray (advanced).*@xas: XArray operation state.* Usually walks the @xas to the appropriate state to load the entry* stored at xa_index. However, it will do nothing and return %NULL if*@xas is in an error state
496  If xa_is_value() - Determine if an entry is a value.*@entry: XArray entry.* Context: Any context.* Return: True if the entry is a value, false if it is a pointer. Then
497  v = xa_to_value() - Get value stored in an XArray entry.*@entry: XArray entry.* Context: Any context.* Return: The value stored in the XArray entry.
498  If bit >= The bottom two bits of the entry determine how the XArray interprets* the contents:* 00: Pointer entry* 10: Internal entry* x1: Value entry or tagged pointer* Attempting to store internal entries in the XArray is a bug. Then Go to err
500  If Not (v & 1UL << bit ) Then Go to err
502  v &= ~(1UL << bit)
503  If Not v Then Go to delete
505  xas_store() - Store this entry in the XArray
506  Else
507  If Not st_bit - Determine whether a bit is set*@nr: bit number to test*@addr: Address to start counting from Then Go to err
509  __clear_bit - Clears a bit in memory*@nr: the bit to clear*@addr: the address to start counting from* Unlike clear_bit(), this function is non-atomic. If it is called on the same* region of memory concurrently, the effect may be that only one operation
510  xas_set_mark() - Sets the mark on this entry and its parents.*@xas: XArray operation state.*@mark: Mark number.* Sets the specified mark on this entry, and walks up the tree setting it* on all the ancestor entries
512  kfree(bitmap)
513  delete :
517  xas_unlock_irqrestore( & xas, flags)
518  Return
519  err :
520  xas_unlock_irqrestore( & xas, flags)
521  WARN(1, "ida_free called for id=%d which is not allocated.\n", id)
Caller
NameDescribe
ida_check_allocStraightforward checks that allocating and freeing IDs work.
ida_check_leafCheck what happens when we fill a leaf and then delete it. This may* discover mishandling of IDR_FREE.
ida_check_convCheck handling of conversions between exceptional entries and full bitmaps.
memregion_free
objagg_obj_root_id_free
mnt_free_id
mnt_release_group_idRelease a peer group ID
devpts_kill_index