Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:ss_tryget_online_from_dir - get corresponding css from a cgroup dentry*@dentry: directory dentry of interest*@ss: subsystem of interest* If @dentry is a directory for a cgroup which has @ss enabled on it, try* to get the corresponding css and return it

Proto:struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry, struct cgroup_subsys *ss)

Type:struct cgroup_subsys_state

Parameter:

TypeParameterName
struct dentry *dentry
struct cgroup_subsys *ss
6072  kn = kernfs_node_from_dentry(dentry)
6073  s_type = s_type
6074  struct cgroup_subsys_state * css = NULL
6078  If s_type != cgroup_fs_type && s_type != cgroup2_fs_type || Not kn || kernfs_type(kn) != KERNFS_DIR Then Return ERR_PTR( - EBADF)
6082  _read_lock() - mark the beginning of an RCU read-side critical section* When synchronize_rcu() is invoked on one CPU while other CPUs* are within RCU read-side critical sections, then the* synchronize_rcu() is guaranteed to block until after all the other
6089  cgrp = fetch RCU-protected pointer for dereferencing( * (void__rcu__force * * ) & priv)
6090  If cgrp Then css = group_css - obtain a cgroup's css for the specified subsystem*@cgrp: the cgroup of interest*@ss: the subsystem of interest (%NULL returns @cgrp->self)* Return @cgrp's css (cgroup_subsys_state) associated with @ss
6093  If Not css || Not ss_tryget_online - try to obtain a reference on the specified css if online*@css: target css* Obtain a reference on @css if it's online Then css = ERR_PTR( - ENOENT)
6096  _read_unlock() - marks the end of an RCU read-side critical section.* In most situations, rcu_read_unlock() is immune from deadlock.* However, in kernels built with CONFIG_RCU_BOOST, rcu_read_unlock()
6097  Return css
Caller
NameDescribe
cgroup_get_from_fdgroup_get_from_fd - get a cgroup pointer from a fd*@fd: fd obtained by open(cgroup2_dir)* Find the cgroup from a fd which should be obtained* by opening a cgroup directory. Returns a pointer to the* cgroup on success. ERR_PTR is returned if the cgroup