Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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 activityDownload SCCTChinese

Name:mb_cache_shrink

Proto:static unsigned long mb_cache_shrink(struct mb_cache *cache, unsigned long nr_to_scan)

Type:unsigned long

Parameter:

TypeParameterName
struct mb_cache *cache
unsigned longnr_to_scan
285  shrunk = 0
287  spin_lock( & Protects c_list, c_entry_count )
288  When nr_to_scan-- && Not list_empty - tests whether a list is empty*@head: the list to test. cycle
289  entry = list_first_entry - get the first element from a list*@ptr: the list head to take the element from.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.* Note, that list is expected to be not empty.( & c_list, structmb_cache_entry, e_list)
291  If e_referenced Then
292  e_referenced = 0
294  Continue
296  list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
297  Number of entries in cache --
302  spin_unlock( & Protects c_list, c_entry_count )
303  head = mb_cache_entry_head(cache, Key in hash - stable during lifetime of the entry )
304  hlist_bl_lock(head)
307  atomic_dec( & e_refcnt)
309  hlist_bl_unlock(head)
310  If mb_cache_entry_put(cache, entry) Then shrunk++
312  cond_resched()
313  spin_lock( & Protects c_list, c_entry_count )
315  spin_unlock( & Protects c_list, c_entry_count )
317  Return shrunk
Caller
NameDescribe
mb_cache_entry_createmb_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?
mb_cache_scan
mb_cache_shrink_worker