函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\slab_common.c Create Date:2022-07-27 15:54:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:create_cache

函数原型:static struct kmem_cache *create_cache(const char *name, unsigned int object_size, unsigned int align, slab_flags_t flags, unsigned int useroffset, unsigned int usersize, void (*ctor)(void *), struct mem_cgroup *memcg, struct kmem_cache *root_cache)

返回类型:struct kmem_cache

参数:

类型参数名称
const char *name
unsigned intobject_size
unsigned intalign
slab_flags_tflags
unsigned intuseroffset
unsigned intusersize
void (*ctor
struct mem_cgroup *memcg
struct kmem_cache *root_cache
388  如果WARN_ON(useroffset + usersize > object_size)则useroffset等于usersize等于0
391  err等于负ENOMEM
392  s等于Shortcuts
393  如果非s则转到:out
396  Name (only for display!) 等于name
397  The size of an object including metadata 等于The size of an object without metadata 等于object_size
398  Alignment 等于align
399  ctor等于ctor
400  Usercopy region offset 等于useroffset
401  Usercopy region size 等于usersize
403  err等于init_memcg_params(s, root_cache)
404  如果err则转到:out_free_cache
407  err等于Functions provided by the slab allocators
408  如果err则转到:out_free_cache
411  Refcount for slab cache destroy 等于1
412  添加链表项
413  memcg_link_cache(s, memcg)
414  out :
415  如果err则返回:错误号
417  返回:s
419  out_free_cache :
420  destroy_memcg_params(s)
421  kmem_cache_free(kmem_cache, s)
422  转到:out
调用者
名称描述
kmem_cache_create_usercopykmem_cache_create_usercopy - Create a cache with a region suitable* for copying to userspace*@name: A string which is used in /proc/slabinfo to identify this cache.*@size: The size of objects to be created in this cache.