Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:compat_fillonedir

Proto:static int compat_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
413  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, structcompat_readdir_callback, ctx)
415  __user * dirent
418  If result Then Return -EINVAL
420  d_ino = ino
421  If size of d_ino < size of ino && d_ino != ino Then
422  result = -EOVERFLOW
423  Return -EOVERFLOW
425  result++
426  dirent = dirent
427  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
431  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
437  Return 0
438  efault :
439  result = -EFAULT
440  Return -EFAULT