summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorAleksa Sarai <cyphar@cyphar.com>2015-06-06 10:02:14 +1000
committerSasha Levin <alexander.levin@verizon.com>2017-06-07 22:52:11 -0400
commit4bb916c171fa2dd59d6c215c5be4b511ad21cf0b (patch)
treed67a17014e6500352c50528a56737ff3587837ec /include/linux
parent034dd596324d53e0d7dd9a7a3f3290e6982eb1b4 (diff)
cgroup: use bitmask to filter for_each_subsys
[ Upstream commit cb4a316752709be4a644f070440a8be470d92b7d ] Add a new macro for_each_subsys_which that allows all enabled cgroup subsystems to be filtered by a bitmask, such that mask & (1 << ssid) determines if the subsystem is to be processed in the loop body (where ssid is the unique id of the subsystem). Also replace the need_forkexit_callback with two separate bitmasks for each callback to make (ss->{fork,exit}) checks unnecessary. tj: add a short comment for "if (!CGROUP_SUBSYS_COUNT)". Signed-off-by: Aleksa Sarai <cyphar@cyphar.com> Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/cgroup-defs.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/cgroup-defs.h b/include/linux/cgroup-defs.h
index 7c40e75a49ea..9c33ea5ec4cb 100644
--- a/include/linux/cgroup-defs.h
+++ b/include/linux/cgroup-defs.h
@@ -472,6 +472,8 @@ void cgroup_threadgroup_change_end(struct task_struct *tsk);
#else /* CONFIG_CGROUPS */
+#define CGROUP_SUBSYS_COUNT 0
+
static inline void cgroup_threadgroup_change_begin(struct task_struct *tsk) {}
static inline void cgroup_threadgroup_change_end(struct task_struct *tsk) {}