Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:cgroup_add_file

Proto:static int cgroup_add_file(struct cgroup_subsys_state *css, struct cgroup *cgrp, struct cftype *cft)

Type:int

Parameter:

TypeParameterName
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  If IS_ERR(kn) Then Return PTR_ERR(kn)
3832  ret = set uid and gid of cgroup dirs and files to that of the creator
3833  If ret Then
3834  kernfs_remove(kn)
3835  Return ret
3838  If 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. Then
3839  cfile = css + 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.
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  Return 0
Caller
NameDescribe
cgroup_addrm_files