函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:cgroup_add_file

函数原型:static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup *cgrp, struct cftype *cft)

返回类型:int

参数:

类型参数名称
struct cgroup_subsys_state *css
struct cgroup *cgrp
struct cftype *cft
3818  struct lock_class_key * key = NULL
3822  key等于lockdep_key
3824  kn等于__kernfs_create_file( cgroup kernfs entry , cgroup_file_name(cgrp, cft, name), group_file_mode - deduce file mode of a control file*@cft: the control file in question* S_IRUGO for read, S_IWUSR for write., GLOBAL_ROOT_UID, GLOBAL_ROOT_GID, 0, kf_ops, cft, NULL, key)
3829  如果是错误则返回:错误
3832  ret等于set uid and gid of cgroup dirs and files to that of the creator
3833  如果ret
3834  kernfs_remove(kn)
3835  返回:ret
3838  如果If non-zero, should contain the offset from the start of css to* a struct cgroup_file field. cgroup will record the handle of* the created file into it. The recorded handle can be used as* long as the containing css remains accessible.
3839  cfile等于cssIf non-zero, should contain the offset from the start of css to* a struct cgroup_file field. cgroup will record the handle of* the created file into it. The recorded handle can be used as* long as the containing css remains accessible.
3841  imer_setup - prepare a timer for first use*@timer: the timer in question*@callback: the function to call when timer expires*@flags: any TIMER_* flags* Regular timer initialization should use either DEFINE_TIMER() above,* or timer_setup()( & notify_timer, cgroup_file_notify_timer, 0)
3843  spin_lock_irq( & Protects cgroup_file->kn for !self csses. It synchronizes notifications* against file removal/re-creation across css hiding.)
3844  do not access any fields from outside cgroup core 等于kn
3845  spin_unlock_irq( & Protects cgroup_file->kn for !self csses. It synchronizes notifications* against file removal/re-creation across css hiding.)
3848  返回:0
调用者
名称描述
cgroup_addrm_files