Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:Extended attribute GET operations

Proto:static ssize_t getxattr(struct dentry *d, const char __user *name, void __user *value, size_t size)

Type:ssize_t

Parameter:

TypeParameterName
struct dentry *d
const char __user *name
void __user *value
size_tsize
521  void * kvalue = NULL
524  error = Copy a NUL terminated string from userspace
525  If error == 0 || error == size of kname Then error = -ERANGE
527  If error < 0 Then Return error
530  If size Then
531  If size > size of an extended attribute value (64k) Then size = size of an extended attribute value (64k)
533  kvalue = kvzalloc(size, GFP_KERNEL)
534  If Not kvalue Then Return -ENOMEM
538  error = vfs_getxattr(d, kname, kvalue, size)
539  If error > 0 Then
540  If strcmp(kname, XATTR_NAME_POSIX_ACL_ACCESS) == 0 || strcmp(kname, XATTR_NAME_POSIX_ACL_DEFAULT) == 0 Then posix_acl_fix_xattr_to_user(kvalue, error)
543  If size && copy_to_user(value, kvalue, error) Then error = -EFAULT
545  Else if error == -ERANGE && size >= size of an extended attribute value (64k) Then
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  Return error
Caller
NameDescribe
path_getxattr
SYSCALL_DEFINE4