函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:Extended attribute SET operations

函数原型:static long setxattr(struct dentry *d, const char __user *name, const void __user *value, size_t size, int flags)

返回类型:long

参数:

类型参数名称
struct dentry *d
const char __user *name
const void __user *value
size_tsize
intflags
418  void * kvalue = NULL
421  如果flags按位与set value, fail if attr already exists 按位或set value, fail if attr does not exist 的值的反则返回:负EINVAL
424  error等于复制用户字符串
425  如果error恒等于0或error恒等于kname的长度则error等于负ERANGE
427  如果error小于0则返回:error
430  如果size
431  如果size大于size of an extended attribute value (64k) 则返回:负E2BIG
433  kvalue等于kvmalloc(size, GFP_KERNEL)
434  如果非kvalue则返回:负ENOMEM
436  如果copy_from_user(kvalue, value, size)则
437  error等于负EFAULT
438  转到:out
440  如果strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS)恒等于0或字符串比较恒等于0则posix_acl_fix_xattr_from_user(kvalue, size)
443  否则如果字符串比较恒等于0则
444  error等于cap_convert_nscap(d, & kvalue, size)
445  如果error小于0则转到:out
447  size等于error
451  error等于vfs_setxattr(d, kname, kvalue, size, flags)
452  out :
453  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.
455  返回:error
调用者
名称描述
path_setxattr
SYSCALL_DEFINE5