Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:iterate_dir

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

Type:int

Parameter:

TypeParameterName
struct file *file
struct dir_context *ctx
42  inode = file_inode(file)
43  bool shared = false
44  res = -ENOTDIR
45  If iterate_shared Then shared = true
47  Else if Not iterate Then Go to out
50  res = security_file_permission(file, MAY_READ)
51  If res Then Go to out
54  If shared Then res = down_read_killable( & i_rwsem)
56  Else res = lock for writing
58  If res Then Go to out
61  res = -ENOENT
62  If Not IS_DEADDIR(inode) Then
63  pos = f_pos
64  If shared Then res = iterate_shared(file, ctx)
66  Else res = iterate(file, ctx)
68  f_pos = pos
69  snotify_access - file was read
70  file_accessed(file)
72  If shared Then inode_unlock_shared(inode)
74  Else inode_unlock(inode)
76  out :
77  Return res
Caller
NameDescribe
SYSCALL_DEFINE3
SYSCALL_DEFINE3
ksys_getdents64
COMPAT_SYSCALL_DEFINE3
COMPAT_SYSCALL_DEFINE3