diff options
Diffstat (limited to 'include/linux/cgroup.h')
-rw-r--r-- | include/linux/cgroup.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index c0077adeea83..49e8facf7c4a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
@@ -924,4 +924,22 @@ static inline bool cgroup_task_frozen(struct task_struct *task) | |||
924 | 924 | ||
925 | #endif /* !CONFIG_CGROUPS */ | 925 | #endif /* !CONFIG_CGROUPS */ |
926 | 926 | ||
927 | #ifdef CONFIG_CGROUP_BPF | ||
928 | static inline void cgroup_bpf_get(struct cgroup *cgrp) | ||
929 | { | ||
930 | percpu_ref_get(&cgrp->bpf.refcnt); | ||
931 | } | ||
932 | |||
933 | static inline void cgroup_bpf_put(struct cgroup *cgrp) | ||
934 | { | ||
935 | percpu_ref_put(&cgrp->bpf.refcnt); | ||
936 | } | ||
937 | |||
938 | #else /* CONFIG_CGROUP_BPF */ | ||
939 | |||
940 | static inline void cgroup_bpf_get(struct cgroup *cgrp) {} | ||
941 | static inline void cgroup_bpf_put(struct cgroup *cgrp) {} | ||
942 | |||
943 | #endif /* CONFIG_CGROUP_BPF */ | ||
944 | |||
927 | #endif /* _LINUX_CGROUP_H */ | 945 | #endif /* _LINUX_CGROUP_H */ |