| Function report | 
| Source Code: mm\zbud.c | Create Date:2022-07-28 16:25:48 | 
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick | 
| home page | Tree | 
| Annotation kernel can get tool activity | Download SCCT | Chinese | 
Name:zbud_alloc() - allocates a region of a given size*@pool: zbud pool from which to allocate*@size: size in bytes of the desired allocation*@gfp: gfp flags used if the pool needs to grow*@handle: handle of the new allocation* This function will attempt to
Proto:int zbud_alloc(struct zbud_pool *pool, size_t size, gfp_t gfp, unsigned long *handle)
Type:int
Parameter:
| Type | Parameter | Name | 
|---|---|---|
| struct zbud_pool * | pool | |
| size_t | size | |
| gfp_t | gfp | |
| unsigned long * | handle | 
| 358 | struct zbud_header * zhdr = NULL | 
| 362 | If Not size || gfp & __GFP_HIGHMEM Then Return -EINVAL | 
| 364 | If size > PAGE_SIZE - ZHDR_SIZE_ALIGNED - CHUNK_SIZE Then Return -ENOSPC | 
| 370 | zhdr = NULL | 
| 376 | If first_chunks == 0 Then bud = FIRST | 
| 380 | Go to found | 
| 385 | spin_unlock( & lock) | 
| 386 | page = alloc_page(gfp) | 
| 390 | pages_nr++ | 
| 394 | found : | 
| 395 | If bud == FIRST Then first_chunks = chunks | 
| 397 | Else last_chunks = chunks | 
| 400 | If first_chunks == 0 || last_chunks == 0 Then | 
| 404 | Else | 
| 410 | If Not list_empty - tests whether a list is empty*@head: the list to test. Then deletes entry from list | 
| 414 | handle = Encodes the handle of a particular buddy within a zbud page* Pool lock should be held as this function accesses first|last_chunks | 
| 415 | spin_unlock( & lock) | 
| 417 | Return 0 | 
| Name | Describe | 
|---|---|
| zbud_zpool_malloc | 
| 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 |