Function report |
Source Code:lib\idr.c |
Create Date:2022-07-28 06:13:51 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:da_alloc_range() - Allocate an unused ID.*@ida: IDA handle.*@min: Lowest ID to allocate.*@max: Highest ID to allocate.*@gfp: Memory allocation flags.* Allocate an ID between @min and @max, inclusive. The allocated ID will
Proto:int ida_alloc_range(struct ida *ida, unsigned int min, unsigned int max, gfp_t gfp)
Type:int
Parameter:
Type | Parameter | Name |
---|---|---|
struct ida * | ida | |
unsigned int | min | |
unsigned int | max | |
gfp_t | gfp |
383 | bit = min % IDA_BITMAP_BITS |
385 | struct ida_bitmap * bitmap, * alloc = NULL |
393 | retry : |
394 | xas_lock_irqsave( & xas, flags) |
395 | next : |
397 | If xa_index > min / IDA_BITMAP_BITS Then bit = 0 |
399 | If xa_index * IDA_BITMAP_BITS + bit > max Then Go to nospc |
403 | tmp = xa_to_value() - Get value stored in an XArray entry.*@entry: XArray entry.* Context: Any context.* Return: The value stored in the XArray entry. |
407 | If xa_index * IDA_BITMAP_BITS + bit > max Then Go to nospc |
428 | If bitmap Then |
430 | If xa_index * IDA_BITMAP_BITS + bit > max Then Go to nospc |
432 | If bit == IDA_BITMAP_BITS Then Go to next |
438 | Else |
441 | Else |
451 | out : |
452 | xas_unlock_irqrestore( & xas, flags) |
462 | Return xa_index * IDA_BITMAP_BITS + bit |
463 | alloc : |
464 | xas_unlock_irqrestore( & xas, flags) |
465 | alloc = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). |
469 | bit = min % IDA_BITMAP_BITS |
470 | Go to retry |
471 | nospc : |
472 | xas_unlock_irqrestore( & xas, flags) |
473 | Return -ENOSPC |
Name | Describe |
---|---|
objagg_obj_root_id_alloc | |
ida_alloc | da_alloc() - Allocate an unused ID.*@ida: IDA handle.*@gfp: Memory allocation flags.* Allocate an ID between 0 and %INT_MAX, inclusive.* Context: Any context.* Return: The allocated ID, or %-ENOMEM if memory could not be allocated, |
ida_alloc_min | da_alloc_min() - Allocate an unused ID |
ida_alloc_max | da_alloc_max() - Allocate an unused ID |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |