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:Directory 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.

Proto:int dcache_readdir(struct file *file, struct dir_context *ctx)

Type:int

Parameter:

TypeParameterName
struct file *file
struct dir_context *ctx
186  dentry = dentry
187  cursor = needed for tty driver, and maybe others
188  anchor = our children
189  struct dentry * next = NULL
192  If Not dir_emit_dots(file, ctx) Then Return 0
195  If pos == 2 Then p = anchor
197  Else if Not list_empty - tests whether a list is empty*@head: the list to test. Then p = child of parent list
199  Else Return 0
202  When ((next = Returns an element of siblings' list.* We are looking for th positive after

; if* found, dentry is grabbed and returned to caller.* If no such element exists, NULL is returned.) != NULL) cycle

203  If Not dir_emit(ctx, name, len, i_ino, Relationship between i_mode and the DT_xxx types ) Then Break
206  pos++
207  p = child of parent list
209  spin_lock( & d_lock)
210  If next Then list_move_tail - delete from one list and add as another's tail*@list: the entry to move*@head: the head that will follow our entry
212  Else list_del_init - deletes entry from list and reinitialize it.*@entry: the element to delete from the list.
214  spin_unlock( & d_lock)
215  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
217  Return 0