Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\lru_cache.c Create Date:2022-07-28 07:16:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:lc_reset - does a full reset for @lc and the hash table slots.*@lc: the lru cache to operate on* It is roughly the equivalent of re-allocating a fresh lru_cache object,* basically a short cut to lc_destroy(lc); lc = lc_create(...);

Proto:void lc_reset(struct lru_cache *lc)

Type:void

Parameter:

TypeParameterName
struct lru_cache *lc
197  Initialization list head
198  Initialization list head
199  Initialization list head
200  Initialization list head
201  number of elements currently on in_use list = 0
202  hits = 0
203  misses = 0
204  starving = 0
205  locked = 0
206  changed = 0
207  number of elements currently on to_be_changed list = 0
208  see below: flag-bits for lru_cache = 0
209  memset( nr_elements there , 0, sizeof(structhlist_head) * number of elements (indices) )
211  When i < number of elements (indices) cycle
212  e = lc_element[i]
213  p = e
214  p -= offset of struct lc_element member in the tracked object
215  memset(p, 0, size of tracked objects, used to memset(,0,) them in lc_reset )
217  ack "pointer" into lc_cache->element[index],* for paranoia, and for "lc_element_to_index" = i
218  we want to track a larger set of objects,* it needs to become arch independend u64 = special label when on free list
219  r pending changes = special label when on free list
220  list_add - add a new entry*@new: new entry to be added*@head: list head to add it after* Insert a new entry after the specified head.* This is good for implementing stacks.