函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:mb_cache_create - create cache*@bucket_bits: log2 of the hash table size* Create cache for keys with 2^bucket_bits hash entries.

函数原型:struct mb_cache *mb_cache_create(int bucket_bits)

返回类型:struct mb_cache

参数:

类型参数名称
intbucket_bits
347  bucket_count等于1UL左移bucket_bits
350  cache等于分配内存并置零
351  如果非cache则转到:err_out
353  log2 of hash table size 等于bucket_bits
354  Maximum entries in cache to avoid degrading hash too much 等于bucket_count左移4位
355  初始化链表头
356  spin_lock_init( & Protects c_list, c_entry_count )
357  Hash table of entries 等于分配数组内存
360  如果非Hash table of entries
361  释放内存
362  转到:err_out
364 i小于bucket_count循环INIT_HLIST_BL_HEAD( & Hash table of entries [i])
367  count_objects等于mb_cache_count
368  scan_objects等于mb_cache_scan
369  seeks to recreate an obj 等于A good number if you don't know better.
370  如果register_shrinker( & c_shrink)则
371  释放内存
372  释放内存
373  转到:err_out
376  INIT_WORK( & Work for shrinking when the cache has too many entries , mb_cache_shrink_worker)
378  返回:cache
380  err_out :
381  返回:NULL