函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称: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

函数原型:int kobject_uevent_env(struct kobject *kobj, enum kobject_action action, char *envp_ext[])

返回类型:int

参数:

类型参数名称
struct kobject *kobj
enum kobject_actionaction
char *envp_ext
460  action_string等于he strings here must match the enum in include/linux/kobject.h [action]
461  const char * devpath = NULL
466  i等于0
467  retval等于0
473  如果action恒等于重置设备state_remove_uevent_sent等于1
476  pr_debug("kobject: '%s' (%p): %s\n", kobject_name(kobj), kobj, __func__)
480  top_kobj等于kobj
481  当非设备组指针父设备指针循环
482  top_kobj等于父设备指针
484  如果非设备组指针
485  pr_debug("kobject: '%s' (%p): %s: attempted to send uevent without kset!\n", kobject_name(kobj), kobj, __func__)
488  返回:负EINVAL
491  kset等于设备组指针
492  uevent_ops等于uevent_ops
495  如果uevent_suppress
496  pr_debug("kobject: '%s' (%p): %s: uevent_suppress caused the event to drop!\n", kobject_name(kobj), kobj, __func__)
499  返回:0
502  如果uevent_opsfilter则如果非filter(kset, kobj)则
504  pr_debug("kobject: '%s' (%p): %s: filter function caused the event to drop!\n", kobject_name(kobj), kobj, __func__)
507  返回:0
511  如果uevent_opsnamesubsystem等于name(kset, kobj)
513  否则subsystem等于kobject_name( & 设备对象)
515  如果非subsystem
516  pr_debug("kobject: '%s' (%p): %s: unset subsystem caused the event to drop!\n", kobject_name(kobj), kobj, __func__)
519  返回:0
523  env等于分配内存并置零
524  如果非env则返回:负ENOMEM
528  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().
529  如果非devpath
530  retval等于负ENOENT
531  转到:exit
535  retval等于 向环境缓冲区添加键值字符串
536  如果retval则转到:exit
538  retval等于 向环境缓冲区添加键值字符串
539  如果retval则转到:exit
541  retval等于 向环境缓冲区添加键值字符串
542  如果retval则转到:exit
546  如果envp_ext
547 envp_ext[i]循环
549  如果retval则转到:exit
555  如果uevent_opsuevent
556  retval等于uevent(kset, kobj, env)
557  如果retval
558  pr_debug("kobject: '%s' (%p): %s: uevent() returned %d\n", kobject_name(kobj), kobj, __func__, retval)
561  转到:exit
566  :action恒等于添加设备
574  state_add_uevent_sent等于1
575  退出
577  :action恒等于KOBJ_UNBIND
579  退出
581  默认
582  退出
588  如果retval
623  exit :
624  释放内存
625  释放内存
626  返回:retval
调用者
名称描述
kobject_synth_ueventkobject_synth_uevent - send synthetic uevent with arguments*@kobj: struct kobject for which synthetic uevent is to be generated*@buf: buffer containing action type and action args, newline is ignored*@count: length of buffer* Returns 0 if
kobject_uevent通过发送一个uevent通知用户空间
kobject_renamekobject_rename() - Change the name of an object
kobject_move移动对象
disk_check_events
set_disk_ro_uevent