lists.openwall.net | lists / announce owl-users owl-dev john-users john-dev passwdqc-users yescrypt popa3d-users / oss-security kernel-hardening musl sabotage tlsify passwords / crypt-dev xvendor / Bugtraq Full-Disclosure linux-kernel linux-netdev linux-ext4 linux-hardening PHC | |
Open Source and information security mailing list archives
| ||
|
Date: Mon, 14 Jul 2014 10:13:27 +0800 From: Li Zefan <lizefan@...wei.com> To: Tejun Heo <tj@...nel.org> CC: <cgroups@...r.kernel.org>, <linux-kernel@...r.kernel.org>, Johannes Weiner <hannes@...xchg.org>, Michal Hocko <mhocko@...e.cz>, Vivek Goyal <vgoyal@...hat.com>, Peter Zijlstra <a.p.zijlstra@...llo.nl>, Paul Mackerras <paulus@...ba.org>, Ingo Molnar <mingo@...hat.com>, Arnaldo Carvalho de Melo <acme@...nel.org>, Aristeu Rozanski <aris@...hat.com>, Neil Horman <nhorman@...driver.com>, "Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com> Subject: Re: [PATCH 4/5] cgroup: distinguish the default and legacy hierarchies when handling cftypes > @@ -3085,8 +3091,37 @@ static int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) > return ret; > } > > +/** > + * cgroup_add_dfl_cftypes - add an array of cftypes for default hierarchy > + * @ss: target cgroup subsystem > + * @cfts: zero-length name terminated array of cftypes > + * > + * Similar to cgroup_add_cftypes() but the added files are only used for > + * the default hierarchy. > + */ > +int cgroup_add_dfl_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) > +{ > + struct cftype *cft; > + > + for (cft = cfts; cft && cft->name[0] != '\0'; cft++) > + cft->flags |= CFTYPE_ONLY_ON_DFL; I think we should remove this flag in cgroup_rm_cftypes_locked(). Otherwise if we call cgroup_add_dlf_cftypes() and then cgroup_rm_cftypes() and then cgroup_add_legacy_cftypes() for the same @cfts, both CFTYPE_ONLY_ON_DFL and CFTYPE_INSANE are set. > + return cgroup_add_cftypes(ss, cfts); > +} > + > +/** > + * cgroup_add_legacy_cftypes - add an array of cftypes for legacy hierarchies > + * @ss: target cgroup subsystem > + * @cfts: zero-length name terminated array of cftypes > + * > + * Similar to cgroup_add_cftypes() but the added files are only used for > + * the legacy hierarchies. > + */ > int cgroup_add_legacy_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) > { > + struct cftype *cft; > + > + for (cft = cfts; cft && cft->name[0] != '\0'; cft++) > + cft->flags |= CFTYPE_INSANE; > return cgroup_add_cftypes(ss, cfts); > } -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@...r.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists