函数逻辑报告 |
Source Code:mm\z3fold.c |
Create Date:2022-07-27 18:05:19 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:z3fold_alloc() - allocates a region of a given size*@pool: z3fold 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
函数原型:static int z3fold_alloc(struct z3fold_pool *pool, size_t size, gfp_t gfp, unsigned long *handle)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
struct z3fold_pool * | pool | |
size_t | size | |
gfp_t | gfp | |
unsigned long * | handle |
1093 | struct z3fold_header * zhdr = NULL |
1096 | can_sleep等于gfpflags_allow_blocking(gfp) |
1104 | 如果size大于PAGE_SIZE减ZHDR_SIZE_ALIGNED减CHUNK_SIZE则bud等于HEADLESS |
1106 | 否则 |
1107 | retry : |
1109 | 如果zhdr则 |
1110 | 如果first_chunks恒等于0则 |
1111 | 如果middle_chunks不等于0且chunks大于等于start_middle则bud等于LAST |
1116 | 否则如果last_chunks恒等于0则bud等于LAST |
1118 | 否则如果middle_chunks恒等于0则bud等于MIDDLE |
1120 | 否则 |
1124 | 否则Unlock a z3fold page |
1126 | 打印错误信息("No free chunks in unbuddied\n") |
1127 | WARN_ON(1) |
1128 | 转到:retry |
1130 | page等于virt_to_page(kaddr) returns a valid pointer if and only if* virt_addr_valid(kaddr) returns true.(zhdr) |
1131 | 转到:found |
1136 | page = NULL |
1137 | 如果can_sleep则 |
1138 | 加自旋锁 |
1146 | 如果zhdr则 |
1151 | 否则 |
1152 | 自旋锁解锁 |
1155 | 如果非page则page等于alloc_page(gfp) |
1162 | 如果非zhdr则 |
1163 | __free_page(page) |
1164 | 返回:负ENOMEM |
1166 | atomic64_inc( & pages_nr) |
1172 | 如果can_sleep则 |
1174 | __SetPageMovable(page, i_mapping) |
1176 | 否则 |
1178 | __SetPageMovable(page, i_mapping) |
1182 | Lock a z3fold page |
1184 | found : |
1185 | 如果bud恒等于FIRST则first_chunks等于chunks |
1187 | 否则如果bud恒等于LAST则last_chunks等于chunks |
1189 | 否则 |
1190 | middle_chunks等于chunks |
1195 | headless : |
1196 | 加自旋锁 |
1201 | 添加链表项 |
1203 | handle等于encode_handle(zhdr, bud) |
1204 | 自旋锁解锁 |
1205 | 如果bud不等于HEADLESS则Unlock a z3fold page |
1208 | 返回:0 |
名称 | 描述 |
---|---|
z3fold_zpool_malloc |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |