Messages in this thread | | | Date | Mon, 13 Apr 2015 10:24:39 -0400 | From | Tejun Heo <> | Subject | Re: [PATCH v9 3/4] cgroups: allow a cgroup subsystem to reject a fork |
| |
On Sun, Apr 12, 2015 at 10:51:56AM +1000, Aleksa Sarai wrote: > +/* list of all tags for subsystems */ > +enum cgroup_subsys_tag { > +#define TAG_ID(_t) CGROUP_ ## _t > +#define SUBSYS(_x) UNUSED_IDENT(_x), > +#define TAG(_t) TAG_ID(_t), \ > + UNUSED_IDENT(_t) = TAG_ID(_t) - 2, > +#define _COUNT(_t, _i) _i, \ > + CGROUP_ ## _t ## _COUNT = (TAG_ID(_t ## _END) - TAG_ID(_t ## _START)) + 1, \ > + UNUSED_IDENT(_t) = _i - 1, > +#define COUNT(_t) _COUNT(_t, UNUSED_IDENT(_t)) > +#include <linux/cgroup_subsys.h> > +#undef COUNT > +#undef TAG > +#undef SUBSYS > +#undef TAG_ID > +};
Ummm... is this really necessary? Can't we do something like the following?
#define SUBSYS_TAG(tag) \ __##tag, \ tag = __##tag - 2,
-- tejun
| |