aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/cgroup.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r--include/linux/cgroup.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index 0297f930a56e..f6b048902d6c 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -131,6 +131,8 @@ void cgroup_free(struct task_struct *p);
131int cgroup_init_early(void); 131int cgroup_init_early(void);
132int cgroup_init(void); 132int cgroup_init(void);
133 133
134int cgroup_parse_float(const char *input, unsigned dec_shift, s64 *v);
135
134/* 136/*
135 * Iteration helpers and macros. 137 * Iteration helpers and macros.
136 */ 138 */
@@ -697,6 +699,7 @@ void cgroup_path_from_kernfs_id(const union kernfs_node_id *id,
697struct cgroup_subsys_state; 699struct cgroup_subsys_state;
698struct cgroup; 700struct cgroup;
699 701
702static inline void css_get(struct cgroup_subsys_state *css) {}
700static inline void css_put(struct cgroup_subsys_state *css) {} 703static inline void css_put(struct cgroup_subsys_state *css) {}
701static inline int cgroup_attach_task_all(struct task_struct *from, 704static inline int cgroup_attach_task_all(struct task_struct *from,
702 struct task_struct *t) { return 0; } 705 struct task_struct *t) { return 0; }
@@ -934,4 +937,22 @@ static inline bool cgroup_task_frozen(struct task_struct *task)
934 937
935#endif /* !CONFIG_CGROUPS */ 938#endif /* !CONFIG_CGROUPS */
936 939
940#ifdef CONFIG_CGROUP_BPF
941static inline void cgroup_bpf_get(struct cgroup *cgrp)
942{
943 percpu_ref_get(&cgrp->bpf.refcnt);
944}
945
946static inline void cgroup_bpf_put(struct cgroup *cgrp)
947{
948 percpu_ref_put(&cgrp->bpf.refcnt);
949}
950
951#else /* CONFIG_CGROUP_BPF */
952
953static inline void cgroup_bpf_get(struct cgroup *cgrp) {}
954static inline void cgroup_bpf_put(struct cgroup *cgrp) {}
955
956#endif /* CONFIG_CGROUP_BPF */
957
937#endif /* _LINUX_CGROUP_H */ 958#endif /* _LINUX_CGROUP_H */