函数逻辑报告 |
Source Code:mm\mempool.c |
Create Date:2022-07-27 15:27:45 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
首页 | 函数Tree |
注解内核,赢得工具 | 下载SCCT | English |
函数名称:mempool_resize - resize an existing memory pool*@pool: pointer to the memory pool which was allocated via* mempool_create().*@new_min_nr: the new minimum number of elements guaranteed to be* allocated for this pool.* This function shrinks/grows the pool
函数原型:int mempool_resize(mempool_t *pool, int new_min_nr)
返回类型:int
参数:
类型 | 参数 | 名称 |
---|---|---|
mempool_t * | pool | |
int | new_min_nr |
305 | BUG_ON(new_min_nr <= 0) |
306 | might_sleep() |
308 | spin_lock_irqsave( & lock, flags) |
309 | 如果new_min_nr小于等于 nr of elements at *elements 则 |
311 | element等于remove_element(pool) |
312 | spin_unlock_irqrestore( & lock, flags) |
314 | spin_lock_irqsave( & lock, flags) |
317 | 转到:out_unlock |
319 | spin_unlock_irqrestore( & lock, flags) |
322 | new_elements等于分配数组内存 |
324 | 如果非new_elements则返回:负ENOMEM |
327 | spin_lock_irqsave( & lock, flags) |
328 | 如果此条件成立可能性小(为编译器优化)(new_min_nr <= nr of elements at *elements )则 |
336 | 释放内存 |
337 | elements等于new_elements |
341 | spin_unlock_irqrestore( & lock, flags) |
342 | element等于alloc(GFP_KERNEL, pool_data) |
345 | spin_lock_irqsave( & lock, flags) |
347 | add_element(pool, element) |
348 | 否则 |
354 | out_unlock : |
355 | spin_unlock_irqrestore( & lock, flags) |
356 | out : |
357 | 返回:0 |
源代码转换工具 开放的插件接口 | X |
---|---|
支持:c/c++/esqlc/java Oracle/Informix/Mysql 插件可实现:逻辑报告 代码生成和批量转换代码 |