函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Extended attribute GET operations

函数原型:static ssize_t getxattr(struct dentry *d, const char __user *name, void __user *value, size_t size)

返回类型:ssize_t

参数:

类型参数名称
struct dentry *d
const char __user *name
void __user *value
size_tsize
521  void * kvalue = NULL
524  error等于复制用户字符串
525  如果error恒等于0或error恒等于kname的长度则error等于负ERANGE
527  如果error小于0则返回:error
530  如果size
531  如果size大于size of an extended attribute value (64k) size等于size of an extended attribute value (64k)
533  kvalue等于kvzalloc(size, GFP_KERNEL)
534  如果非kvalue则返回:负ENOMEM
538  error等于vfs_getxattr(d, kname, kvalue, size)
539  如果error大于0则
540  如果字符串比较恒等于0或字符串比较恒等于0则posix_acl_fix_xattr_to_user(kvalue, error)
543  如果sizecopy_to_user(value, kvalue, error)则error等于负EFAULT
545  否则如果error恒等于负ERANGEsize大于等于size of an extended attribute value (64k)
548  error等于负E2BIG
551  kvfree() - Free memory.*@addr: Pointer to allocated memory.* kvfree frees memory allocated by any of vmalloc(), kmalloc() or kvmalloc().* It is slightly more efficient to use kfree() or vfree() if you are certain* that you know which one to use.
553  返回:error
调用者
名称描述
path_getxattr
SYSCALL_DEFINE4