Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:kobject_action_args

Proto:static int kobject_action_args(const char *buf, size_t count, struct kobj_uevent_env **ret_env)

Type:int

Parameter:

TypeParameterName
const char *buf
size_tcount
struct kobj_uevent_env **ret_env
117  struct kobj_uevent_env * env = NULL
120  r = -EINVAL
122  If count && ( buf[count - 1] == '\n' || buf[count - 1] == '\0' ) Then count--
125  If Not count Then Return -EINVAL
128  env = kzalloc - allocate memory. The memory is set to zero.*@size: how many bytes of memory are required.*@flags: the type of memory to allocate (see kmalloc).
129  If Not env Then Return -ENOMEM
133  If count < The length of a UUID string ("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")* not including trailing NUL. || Not uuid_is_valid(buf) || add_uevent_var - add key value string to the environment buffer*@env: environment buffer structure*@format: printf format for the key=value pair* Returns 0 if environment variable was added successfully or -ENOMEM* if no space was available. Then Go to out
141  next = buf + The length of a UUID string ("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")* not including trailing NUL.
142  buf_end = buf + count - 1
144  When next <= buf_end cycle
145  If next != ' ' Then Go to out
149  key = ++next
150  If key > buf_end Then Go to out
153  buf = next
154  next = action_arg_word_end(buf, buf_end, '=')
155  If Not next || next > buf_end || next != '=' Then Go to out
157  key_len = next - buf
160  If ++next > buf_end Then Go to out
163  buf = next
164  next = action_arg_word_end(buf, buf_end, ' ')
165  If Not next Then Go to out
168  If add_uevent_var - add key value string to the environment buffer*@env: environment buffer structure*@format: printf format for the key=value pair* Returns 0 if environment variable was added successfully or -ENOMEM* if no space was available. Then Go to out
173  r = 0
174  out :
175  If r Then kfree(env)
177  Else ret_env = env
179  Return r
Caller
NameDescribe
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