函数逻辑报告 |
Source Code:mm\zbud.c |
Create Date:2022-07-27 18:00:43 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| 首页 | 函数Tree |
| 注解内核,赢得工具 | 下载SCCT | English |
函数名称: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
函数原型:int zbud_alloc(struct zbud_pool *pool, size_t size, gfp_t gfp, unsigned long *handle)
返回类型:int
参数:
| 类型 | 参数 | 名称 |
|---|---|---|
| struct zbud_pool * | pool | |
| size_t | size | |
| gfp_t | gfp | |
| unsigned long * | handle |
| 358 | struct zbud_header * zhdr = NULL |
| 362 | 如果非size或gfp按位与__GFP_HIGHMEM则返回:负EINVAL |
| 364 | 如果size大于PAGE_SIZE减ZHDR_SIZE_ALIGNED减CHUNK_SIZE则返回:负ENOSPC |
| 367 | 加自旋锁 |
| 370 | zhdr = NULL |
| 372 | 如果非链表为空则 |
| 375 | 删除链表项 |
| 376 | 如果first_chunks恒等于0则bud等于FIRST |
| 380 | 转到:found |
| 385 | 自旋锁解锁 |
| 386 | page等于alloc_page(gfp) |
| 389 | 加自旋锁 |
| 390 | pages_nr自加 |
| 394 | found : |
| 395 | 如果bud恒等于FIRST则first_chunks等于chunks |
| 397 | 否则last_chunks等于chunks |
| 400 | 如果first_chunks恒等于0或last_chunks恒等于0则 |
| 404 | 否则 |
| 406 | 添加链表项 |
| 412 | 添加链表项 |
| 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 | 自旋锁解锁 |
| 417 | 返回:0 |
| 名称 | 描述 |
|---|---|
| zbud_zpool_malloc |
| 源代码转换工具 开放的插件接口 | X |
|---|---|
| 支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |