]> git.baikalelectronics.ru Git - kernel.git/commit
cgroup: use bitmask to filter for_each_subsys
authorAleksa Sarai <cyphar@cyphar.com>
Sat, 6 Jun 2015 00:02:14 +0000 (10:02 +1000)
committerTejun Heo <tj@kernel.org>
Mon, 8 Jun 2015 09:17:32 +0000 (18:17 +0900)
commitdd4154e10fc74b297c1ecad58632d81361e9fed6
treee2c09e4f265f3c2df2bb3fc2a5aff19165aa4135
parent8802e6bfb309ab3d0b485a8e091c30d988f26d56
cgroup: use bitmask to filter for_each_subsys

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>
include/linux/cgroup-defs.h
kernel/cgroup.c