Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\super.c Create Date:2022-07-28 20:02:20
Last Modify:2022-05-24 06:42:17 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:One thing we have to be careful of with a per-sb shrinker is that we don't* drop the last active reference to the superblock from within the shrinker.* If that happens we could trigger unregistering the shrinker from within the

Proto:static unsigned long super_cache_scan(struct shrinker *shrink, struct shrink_control *sc)

Type:unsigned long

Parameter:

TypeParameterName
struct shrinker *shrink
struct shrink_control *sc
65  fs_objects = 0
67  freed = 0
71  sb = container_of - cast a member of a structure out to the containing structure*@ptr: the pointer to the member.*@type: the type of the container struct this is embedded in.*@member: the name of the member within the struct.(shrink, structsuper_block, s_shrink)
77  If Not (gfp_mask & __GFP_FS) Then Return SHRINK_STOP
80  If Not rylock_super - try to grab ->s_umount shared*@sb: reference we are trying to grab* Try to prevent fs shutdown. This is used in places where we* cannot take an active reference but we need to ensure that the Then Return SHRINK_STOP
83  If nr_cached_objects Then fs_objects = nr_cached_objects(sb, sc)
86  inodes = list_lru_shrink_count( & s_inode_lru, sc)
87  dentries = list_lru_shrink_count( & s_dentry_lru, sc)
88  total_objects = dentries + inodes + fs_objects + 1
89  If Not total_objects Then total_objects = 1
93  dentries = Multiplies an integer by a fraction, while avoiding unnecessary* overflow or loss of precision.(nr_to_scan, dentries, total_objects)
94  inodes = Multiplies an integer by a fraction, while avoiding unnecessary* overflow or loss of precision.(nr_to_scan, inodes, total_objects)
95  fs_objects = Multiplies an integer by a fraction, while avoiding unnecessary* overflow or loss of precision.(nr_to_scan, fs_objects, total_objects)
104  nr_to_scan = dentries + 1
105  freed = prune_dcache_sb(sb, sc)
106  nr_to_scan = inodes + 1
107  freed += de.c
109  If fs_objects Then
110  nr_to_scan = fs_objects + 1
111  freed += free_cached_objects(sb, sc)
114  lease a read lock
115  Return freed