Function report |
Source Code:mm\vmalloc.c |
Create Date:2022-07-28 14:59:27 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:vb_alloc
Proto:static void *vb_alloc(unsigned long size, gfp_t gfp_mask)
Type:void
Parameter:
Type | Parameter | Name |
---|---|---|
unsigned long | size | |
gfp_t | gfp_mask |
1610 | void * vaddr = NULL |
1613 | BUG_ON(offset_in_page(size)) |
1614 | BUG_ON(size > PAGE_SIZE * 256K with 4K pages ) |
1621 | Return NULL |
1623 | order = get_order - Determine the allocation order of a memory size*@size: The size for which to get the order* Determine the allocation order of a particular sized block of memory |
1626 | vbq = Must be an lvalue. Since @var must be a simple identifier,* we force a syntax error here if it isn't.(Queue of free and dirty vmap blocks, for allocation and flushing purposes ) |
1632 | spin_unlock( & lock) |
1633 | Continue |
1636 | pages_off = VMAP_BBMAP_BITS - free |
1637 | vaddr = vmap_block_vaddr(va_start, pages_off) |
1639 | If free == 0 Then |
1642 | spin_unlock( & lock) |
1645 | spin_unlock( & lock) |
1646 | Break |
1649 | The weird & is necessary because sparse considers (void)(var) to be* a direct dereference of percpu variable (var).(Queue of free and dirty vmap blocks, for allocation and flushing purposes ) |
1653 | If Not vaddr Then vaddr = w_vmap_block - allocates new vmap_block and occupies 2^order pages in this* block |
1656 | Return vaddr |
Name | Describe |
---|---|
vm_map_ram | vm_map_ram - map pages linearly into kernel virtual address (vmalloc space)*@pages: an array of pointers to the pages to be mapped*@count: number of pages*@node: prefer to allocate data structures on this node*@prot: memory protection to use |
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 |