函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:fs\libfs.c Create Date:2022-07-29 10:40:56
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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.

函数原型:int dcache_readdir(struct file *file, struct dir_context *ctx)

返回类型:int

参数:

类型参数名称
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  如果非dir_emit_dots(file, ctx)则返回:0
195  如果pos恒等于2则p等于anchor
197  否则如果非链表为空p等于 child of parent list
199  否则返回:0
202  当((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)循环

203  如果非dir_emit(ctx, name, len, i_ino, Relationship between i_mode and the DT_xxx types )则退出
206  pos自加
207  p等于 child of parent list
209  加自旋锁
210  如果next链表项移动到尾部
212  否则删除链表项并重新初始化
214  自旋锁解锁
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  返回:0