Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\kobject.c Create Date:2022-07-28 06:16:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:kobject_move() - Move object to another parent.*@kobj: object in question.*@new_parent: object's new parent (can be NULL)

Proto:int kobject_move(struct kobject *kobj, struct kobject *new_parent)

Type:int

Parameter:

TypeParameterName
struct kobject *kobj
struct kobject *new_parent
558  const char * devpath = NULL
559  char * devpath_string = NULL
562  kobj = kobject_get() - Increment refcount for object.*@kobj: object.
563  If Not kobj Then Return -EINVAL
565  new_parent = kobject_get() - Increment refcount for object.*@kobj: object.
566  If Not new_parent Then
567  If kset Then new_parent = kobject_get() - Increment refcount for object.*@kobj: object.
572  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().
573  If Not devpath Then
574  error = -ENOMEM
575  Go to out
577  devpath_string = Allocation memory
578  If Not devpath_string Then
579  error = -ENOMEM
580  Go to out
582  sprintf - Format a string and place it in a buffer*@buf: The buffer to place the result into*@fmt: The format string to use*@...: Arguments for the format string* The function returns the number of characters written* into @buf
583  envp[0] = devpath_string
584  envp[1] = NULL
585  error = sysfs_move_dir_ns(kobj, new_parent, kobject_namespace() - Return @kobj's namespace tag.*@kobj: kobject in question* Returns namespace tag of @kobj if its parent has namespace ops enabled* and thus @kobj should have a namespace tag associated with it. Returns* %NULL otherwise.)
586  If error Then Go to out
588  old_parent = parent
589  parent = new_parent
590  new_parent = NULL
591  kobject_put() - Decrement refcount for object.*@kobj: object.* Decrement the refcount, and if 0, call kobject_cleanup().
592  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
593  out :
594  kobject_put() - Decrement refcount for object.*@kobj: object.* Decrement the refcount, and if 0, call kobject_cleanup().
595  kobject_put() - Decrement refcount for object.*@kobj: object.* Decrement the refcount, and if 0, call kobject_cleanup().
596  kfree(devpath_string)
597  kfree(devpath)
598  Return error