函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\mbcache.c Create Date:2022-07-29 11:04:34
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:mb_cache_entry_create - create entry in cache*@cache - cache where the entry should be created*@mask - gfp mask with which the entry should be allocated*@key - key of the entry*@value - value of the entry*@reusable - is the entry reusable by others?

函数原型:int mb_cache_entry_create(struct mb_cache *cache, gfp_t mask, unsigned int key, u64 value, bool reusable)

返回类型:int

参数:

类型参数名称
struct mb_cache *cache
gfp_tmask
unsigned intkey
u64value
boolreusable
82  如果Number of entries in cache 大于等于Maximum entries in cache to avoid degrading hash too much schedule_work - put work task in global workqueue*@work: job to be done* Returns %false if @work was already on the kernel-global workqueue and* %true otherwise
85  如果Number of entries in cache 大于等于2乘Maximum entries in cache to avoid degrading hash too much mb_cache_shrink(cache, Number of entries to reclaim synchronously when there are too many entries* in cache)
88  entry等于分配高速缓存区
89  如果非entry则返回:负ENOMEM
92  初始化链表头
94  atomic_set( & e_refcnt, 1)
95  Key in hash - stable during lifetime of the entry 等于key
96  User provided value - stable during lifetime of the entry 等于value
97  e_reusable等于reusable
98  e_referenced等于0
99  head等于mb_cache_entry_head(cache, key)
100  hlist_bl_lock(head)
102  如果 Key in hash - stable during lifetime of the entry 恒等于key User provided value - stable during lifetime of the entry 恒等于value
103  hlist_bl_unlock(head)
104  kmem_cache_free(mb_entry_cache, entry)
105  返回:负EBUSY
108  hlist_bl_add_head( & Hash table list - protected by hash chain bitlock , head)
109  hlist_bl_unlock(head)
111  加自旋锁
112  添加链表项
114  atomic_inc( & e_refcnt)
115  Number of entries in cache 自加
116  自旋锁解锁
118  返回:0