Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\libfs.c Create Date:2022-07-28 20:10:23
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:Returns an element of siblings' list.* We are looking for <count>th positive after <p>; if* found, dentry is grabbed and returned to caller.* If no such element exists, NULL is returned.

Proto:static struct dentry *scan_positives(struct dentry *cursor, struct list_head *p, loff_t count, struct dentry *last)

Type:struct dentry

Parameter:

TypeParameterName
struct dentry *cursor
struct list_head *p
loff_tcount
struct dentry *last
103  struct dentry * dentry = parent directory , * found = NULL
105  spin_lock( & d_lock)
106  When (p = next) != our children cycle
107  d = list_entry - get the struct for this entry*@ptr: the &struct list_head pointer.*@type: the type of the struct this is embedded in.*@member: the name of the list_head within the struct.(p, structdentry, d_child)
109  If protected by d_lock & DCACHE_DENTRY_CURSOR Then Continue
111  If simple_positive(d) && Not --count Then
115  spin_unlock( & d_lock)
118  count = 1
120  If need_resched() Then
123  spin_unlock( & d_lock)
124  cond_resched()
125  spin_lock( & d_lock)
128  spin_unlock( & d_lock)
129  dput - release a dentry*@dentry: dentry to release * Release a dentry. This will drop the usage count and if appropriate* call the dentry unlink method as well as removing it from the queues and* releasing its resources
130  Return found
Caller
NameDescribe
dcache_dir_lseek
dcache_readdirDirectory is locked and all positive dentries in it are safe, since* for ramfs-type trees they can't go away without unlink() or rmdir(),* both impossible due to the lock on directory.