函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:simple_xattr_set - xattr SET operation for in-memory/pseudo filesystems*@xattrs: target simple_xattr list*@name: name of the extended attribute*@value: value of the xattr

函数原型:int simple_xattr_set(struct simple_xattrs *xattrs, const char *name, const void *value, size_t size, int flags)

返回类型:int

参数:

类型参数名称
struct simple_xattrs *xattrs
const char *name
const void *value
size_tsize
intflags
874  struct simple_xattr * new_xattr = NULL
875  err等于0
878  如果value
879  new_xattr等于Allocate new xattr and copy in the value; but leave the name to callers.
880  如果非new_xattr则返回:负ENOMEM
883  name等于kstrdup - allocate space for and copy an existing string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Return: newly allocated copy of @s or %NULL in case of error
884  如果非name
885  释放内存
886  返回:负ENOMEM
890  加自旋锁
892  如果非字符串比较
894  xattr等于new_xattr
895  err等于负EEXIST
896  否则如果new_xattr
898  否则
901  转到:out
904  如果flags按位与set value, fail if attr does not exist
905  xattr等于new_xattr
906  err等于负ENODATA
907  否则
908  添加链表项
909  xattr = NULL
911  out :
912  自旋锁解锁
913  如果xattr
914  释放内存
915  释放内存
917  返回:err