Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:fillonedir

Proto:static int fillonedir(struct dir_context *ctx, const char *name, int namlen, loff_t offset, u64 ino, unsigned int d_type)

Type:int

Parameter:

TypeParameterName
struct dir_context *ctx
const char *name
intnamlen
loff_toffset
u64ino
unsigned intd_type
146  buf = 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.(ctx, structreaddir_callback, ctx)
148  __user * dirent
151  If result Then Return -EINVAL
153  d_ino = ino
154  If size of d_ino < size of ino && d_ino != ino Then
155  result = -EOVERFLOW
156  Return -EOVERFLOW
158  result++
159  dirent = dirent
160  If Not access_ok - Checks if a user space pointer is valid*@addr: User space pointer to start of block to check*@size: Size of block to check* Context: User context only. This function may sleep if pagefaults are* enabled.(dirent, (unsignedlong)(d_name + namlen + 1) - (unsignedlong)dirent) Then Go to efault
164  If Write a simple value into user space, with less checking(d_ino, & d_ino) || Write a simple value into user space, with less checking(offset, & d_offset) || Write a simple value into user space, with less checking(namlen, & d_namlen) || __copy_to_user(d_name, name, namlen) || Write a simple value into user space, with less checking(0, d_name + namlen) Then Go to efault
170  Return 0
171  efault :
172  result = -EFAULT
173  Return -EFAULT