函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:cgroup_threads_write

函数原型:static ssize_t cgroup_threads_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off)

返回类型:ssize_t

参数:

类型参数名称
struct kernfs_open_file *of
char *buf
size_tnbytes
loff_toff
4744  buf等于strstrip(buf)
4746  dst_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
4747  如果非dst_cgrp则返回:负ENODEV
4750  task等于cgroup_procs_write_start(buf, TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., & locked)
4751  ret等于PTR_ERR_OR_ZERO(task)
4752  如果ret则转到:out_unlock
4756  spin_lock_irq( & css_set_lock)
4757  src_cgrp等于Return the cgroup for "task" from the given hierarchy. Must be* called with cgroup_mutex and css_set_lock held.
4758  spin_unlock_irq( & css_set_lock)
4761  ret等于cgroup_procs_write_permission(src_cgrp, dst_cgrp, The root of the dentry tree )
4763  如果ret则转到:out_finish
4767  ret等于负EOPNOTSUPP
4768  如果* If !threaded, self. If threaded, it points to the nearest * domain ancestor. Inside a threaded subtree, cgroups are exempt * from process granularity and no-internal-task constraint. * Domain level resource consumptions which aren't tied to a * specific 不等于* If !threaded, self. If threaded, it points to the nearest * domain ancestor. Inside a threaded subtree, cgroups are exempt * from process granularity and no-internal-task constraint. * Domain level resource consumptions which aren't tied to a * specific 则转到:out_finish
4771  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?
4773  out_finish :
4774  cgroup_procs_write_finish(task, locked)
4775  out_unlock :
4776  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
4778  返回:如果ret否则nbytes