函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:compat_filldir

函数原型:static int compat_filldir(struct dir_context *ctx, const char *name, int namlen, loff_t offset, u64 ino, unsigned int d_type)

返回类型:int

参数:

类型参数名称
struct dir_context *ctx
const char *name
intnamlen
loff_toffset
u64ino
unsigned intd_type
482  __userdirent
483  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_getdents_callback, ctx)
486  reclen等于@a is a power of 2 value (offsetof(structcompat_linux_dirent, d_name) + namlen + 2, sizeof(compat_long_t))
489  error等于负EINVAL
490  如果reclen大于count则返回:负EINVAL
492  d_ino等于ino
493  如果d_ino的长度小于ino的长度且d_ino不等于ino
494  error等于负EOVERFLOW
495  返回:负EOVERFLOW
497  dirent等于previous
498  如果dirent
499  如果signal_pending(当前进程)则返回:负EINTR
501  如果__put_user - Write a simple value into user space, with less checking(offset, & d_off)则转到:efault
504  dirent等于current_dir
505  如果__put_user - Write a simple value into user space, with less checking(d_ino, & d_ino)则转到:efault
507  如果__put_user - Write a simple value into user space, with less checking(reclen, & d_reclen)则转到:efault
509  如果copy_to_user(d_name, name, namlen)则转到:efault
511  如果__put_user - Write a simple value into user space, with less checking(0, d_name + namlen)则转到:efault
513  如果__put_user - Write a simple value into user space, with less checking(d_type, (char__user * )dirent + reclen - 1)则转到:efault
515  previous等于dirent
516  dirent等于direntreclen
517  current_dir等于dirent
518  count减等于reclen
519  返回:0
520  efault :
521  error等于负EFAULT
522  返回:负EFAULT