Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__cgroup1_procs_write

Proto:static ssize_t __cgroup1_procs_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off, bool threadgroup)

Type:ssize_t

Parameter:

TypeParameterName
struct kernfs_open_file *of
char *buf
size_tnbytes
loff_toff
boolthreadgroup
500  cgrp = group_kn_lock_live - locking helper for cgroup kernfs methods*@kn: the kernfs_node being serviced*@drain_offline: perform offline draining on the cgroup* This helper is to be used by a cgroup kernfs method currently servicing*@kn
501  If Not cgrp Then Return -ENODEV
504  task = cgroup_procs_write_start(buf, threadgroup, & locked)
505  ret = PTR_ERR_OR_ZERO(task)
506  If ret Then Go to out_unlock
513  cred = current_cred - Access the current task's subjective credentials* Access the subjective credentials of the current task. RCU-safe,* since nobody else can modify it.()
514  tcred = get_task_cred - Get another task's objective credentials*@task: The task to query* Get the objective credentials of a task, pinning them so that they can't go* away
515  If Not uid_eq( effective UID of the task , GLOBAL_ROOT_UID) && Not uid_eq( effective UID of the task , real UID of the task ) && Not uid_eq( effective UID of the task , saved UID of the task ) Then ret = -EACCES
519  put_cred - Release a reference to a set of credentials*@cred: The credentials to release* Release a reference to a set of credentials, deleting them when the last ref* is released
520  If ret Then Go to out_finish
523  ret = group_attach_task - attach a task or a whole threadgroup to a cgroup*@dst_cgrp: the cgroup to attach to*@leader: the task or the leader of the threadgroup to be attached*@threadgroup: attach the whole threadgroup?
525  out_finish :
526  cgroup_procs_write_finish(task, locked)
527  out_unlock :
528  group_kn_unlock - unlocking helper for cgroup kernfs methods*@kn: the kernfs_node being serviced* This helper undoes cgroup_kn_lock_live() and should be invoked before* the method finishes if locking succeeded
530  Return If ret Else nbytes
Caller
NameDescribe
cgroup1_procs_write
cgroup1_tasks_write