函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:kobject_rename() - Change the name of an object

函数原型:int kobject_rename(struct kobject *kobj, const char *new_name)

返回类型:int

参数:

类型参数名称
struct kobject *kobj
const char *new_name
492  error等于0
493  const char * devpath = NULL
494  dup_name等于NULL
495  char * devpath_string = NULL
498  kobj等于增加引用计数对象
499  如果非kobj则返回:负EINVAL
501  如果非父设备指针
502  递减引用计数对象
503  返回:负EINVAL
506  devpath等于kobject_get_path() - Allocate memory and fill in the path for @kobj.*@kobj: kobject in question, with which to build the path*@gfp_mask: the allocation type used to allocate the path* Return: The newly allocated memory, caller must free with kfree().
507  如果非devpath
508  error等于负ENOMEM
509  转到:out
511  devpath_string等于开辟内存
512  如果非devpath_string
513  error等于负ENOMEM
514  转到:out
516  输出格式化串
517  envp[0]等于devpath_string
518  envp[1] = NULL
520  name等于dup_name等于kstrdup_const - conditionally duplicate an existing const string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Note: Strings allocated by kstrdup_const should be freed by kfree_const.
521  如果非name
522  error等于负ENOMEM
523  转到:out
526  error等于sysfs_rename_dir_ns(kobj, new_name, 返回kobj命名空间标签)
527  如果error则转到:out
531  dup_name等于设备对象名称
532  设备对象名称等于name
537  kobject_uevent_env - send an uevent with environmental data*@kobj: struct kobject that the action is happening to*@action: action that is happening*@envp_ext: pointer to environmental data* Returns 0 if kobject_uevent_env() is completed with success or the
539  out :
540  kfree_const - conditionally free memory*@x: pointer to the memory* Function calls kfree only if @x is not in .rodata section.
541  释放内存
542  释放内存
543  递减引用计数对象
545  返回:error