Function report |
Source Code:fs\mbcache.c |
Create Date:2022-07-28 20:29:33 |
| Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
| home page | Tree |
| Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:mb_cache_create - create cache*@bucket_bits: log2 of the hash table size* Create cache for keys with 2^bucket_bits hash entries.
Proto:struct mb_cache *mb_cache_create(int bucket_bits)
Type:struct mb_cache
Parameter:
| Type | Parameter | Name |
|---|---|---|
| int | bucket_bits |
| 347 | bucket_count = 1UL << bucket_bits |
| 350 | cache = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc). |
| 357 | Hash table of entries = kmalloc_array - allocate memory for an array.*@n: number of elements.*@size: element size.*@flags: the type of memory to allocate (see kmalloc). |
| 360 | If Not Hash table of entries Then |
| 364 | When i < bucket_count cycle INIT_HLIST_BL_HEAD( & Hash table of entries [i]) |
| 367 | count_objects = mb_cache_count |
| 368 | scan_objects = mb_cache_scan |
| 370 | If register_shrinker( & c_shrink) Then |
| 378 | Return cache |
| 380 | err_out : |
| 381 | Return NULL |
| Source code conversion tool public plug-in interface | X |
|---|---|
| Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |