Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1303961
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/6] cgroup: make css_tryget_online_from_dir() also recognize cgroup2 fs |
| Date | 2016-01-07 23:40 +0100 |
| Message-ID | <qOrnR-63O-43@gated-at.bofh.it> (permalink) |
| References | <qOrnQ-63O-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
The function currently returns -EBADF for a directory on the default
hierarchy. Make it also recognize cgroup2_fs_type. This will be used
for perf_event cgroup2 support.
Signed-off-by: Tejun Heo <tj@kernel.org>
---
kernel/cgroup.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index f542264..8a92043 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -5748,12 +5748,13 @@ struct cgroup_subsys_state *css_tryget_online_from_dir(struct dentry *dentry,
struct cgroup_subsys *ss)
{
struct kernfs_node *kn = kernfs_node_from_dentry(dentry);
+ struct file_system_type *s_type = dentry->d_sb->s_type;
struct cgroup_subsys_state *css = NULL;
struct cgroup *cgrp;
/* is @dentry a cgroup dir? */
- if (dentry->d_sb->s_type != &cgroup_fs_type || !kn ||
- kernfs_type(kn) != KERNFS_DIR)
+ if ((s_type != &cgroup_fs_type && s_type != &cgroup2_fs_type) ||
+ !kn || kernfs_type(kn) != KERNFS_DIR)
return ERR_PTR(-EBADF);
rcu_read_lock();
--
2.5.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCHSET] cgroup, perf_event: make perf_event work on v2 hierarchy Tejun Heo <tj@kernel.org> - 2016-01-07 23:40 +0100 [PATCH 2/6] cgroup: convert cgroup_subsys flag fields to bool bitfields Tejun Heo <tj@kernel.org> - 2016-01-07 23:40 +0100 [PATCH 1/6] cgroup: s/cgrp_dfl_root_/cgrp_dfl_/ Tejun Heo <tj@kernel.org> - 2016-01-07 23:40 +0100 [PATCH 3/6] cgroup: make css_tryget_online_from_dir() also recognize cgroup2 fs Tejun Heo <tj@kernel.org> - 2016-01-07 23:40 +0100 [PATCH 6/6] cgroup, perf_event: make perf_event controller work on cgroup2 hierarchy Tejun Heo <tj@kernel.org> - 2016-01-07 23:40 +0100 [PATCH 4/6] cgroup: use ->subtree_control when testing no internal process rule Tejun Heo <tj@kernel.org> - 2016-01-07 23:40 +0100 [PATCH 5/6] cgroup: implement cgroup_subsys->implicit_on_dfl Tejun Heo <tj@kernel.org> - 2016-01-07 23:40 +0100
csiph-web