Loading kernel/cgroup.c +35 −35 Original line number Diff line number Diff line Loading @@ -2417,6 +2417,41 @@ static int cgroup_init_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) return 0; } /** * cgroup_rm_cftypes - remove an array of cftypes from a subsystem * @cfts: zero-length name terminated array of cftypes * * Unregister @cfts. Files described by @cfts are removed from all * existing cgroups and all future cgroups won't have them either. This * function can be called anytime whether @cfts' subsys is attached or not. * * Returns 0 on successful unregistration, -ENOENT if @cfts is not * registered. */ int cgroup_rm_cftypes(struct cftype *cfts) { struct cftype *found = NULL; struct cftype_set *set; if (!cfts || !cfts[0].ss) return -ENOENT; cgroup_cfts_prepare(); list_for_each_entry(set, &cfts[0].ss->cftsets, node) { if (set->cfts == cfts) { list_del(&set->node); kfree(set); found = cfts; break; } } cgroup_cfts_commit(found, false); cgroup_exit_cftypes(cfts); return found ? 0 : -ENOENT; } /** * cgroup_add_cftypes - add an array of cftypes to a subsystem * @ss: target cgroup subsystem Loading Loading @@ -2454,41 +2489,6 @@ int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) } EXPORT_SYMBOL_GPL(cgroup_add_cftypes); /** * cgroup_rm_cftypes - remove an array of cftypes from a subsystem * @cfts: zero-length name terminated array of cftypes * * Unregister @cfts. Files described by @cfts are removed from all * existing cgroups and all future cgroups won't have them either. This * function can be called anytime whether @cfts' subsys is attached or not. * * Returns 0 on successful unregistration, -ENOENT if @cfts is not * registered. */ int cgroup_rm_cftypes(struct cftype *cfts) { struct cftype *found = NULL; struct cftype_set *set; if (!cfts || !cfts[0].ss) return -ENOENT; cgroup_cfts_prepare(); list_for_each_entry(set, &cfts[0].ss->cftsets, node) { if (set->cfts == cfts) { list_del(&set->node); kfree(set); found = cfts; break; } } cgroup_cfts_commit(found, false); cgroup_exit_cftypes(cfts); return found ? 0 : -ENOENT; } /** * cgroup_task_count - count the number of tasks in a cgroup. * @cgrp: the cgroup in question Loading Loading
kernel/cgroup.c +35 −35 Original line number Diff line number Diff line Loading @@ -2417,6 +2417,41 @@ static int cgroup_init_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) return 0; } /** * cgroup_rm_cftypes - remove an array of cftypes from a subsystem * @cfts: zero-length name terminated array of cftypes * * Unregister @cfts. Files described by @cfts are removed from all * existing cgroups and all future cgroups won't have them either. This * function can be called anytime whether @cfts' subsys is attached or not. * * Returns 0 on successful unregistration, -ENOENT if @cfts is not * registered. */ int cgroup_rm_cftypes(struct cftype *cfts) { struct cftype *found = NULL; struct cftype_set *set; if (!cfts || !cfts[0].ss) return -ENOENT; cgroup_cfts_prepare(); list_for_each_entry(set, &cfts[0].ss->cftsets, node) { if (set->cfts == cfts) { list_del(&set->node); kfree(set); found = cfts; break; } } cgroup_cfts_commit(found, false); cgroup_exit_cftypes(cfts); return found ? 0 : -ENOENT; } /** * cgroup_add_cftypes - add an array of cftypes to a subsystem * @ss: target cgroup subsystem Loading Loading @@ -2454,41 +2489,6 @@ int cgroup_add_cftypes(struct cgroup_subsys *ss, struct cftype *cfts) } EXPORT_SYMBOL_GPL(cgroup_add_cftypes); /** * cgroup_rm_cftypes - remove an array of cftypes from a subsystem * @cfts: zero-length name terminated array of cftypes * * Unregister @cfts. Files described by @cfts are removed from all * existing cgroups and all future cgroups won't have them either. This * function can be called anytime whether @cfts' subsys is attached or not. * * Returns 0 on successful unregistration, -ENOENT if @cfts is not * registered. */ int cgroup_rm_cftypes(struct cftype *cfts) { struct cftype *found = NULL; struct cftype_set *set; if (!cfts || !cfts[0].ss) return -ENOENT; cgroup_cfts_prepare(); list_for_each_entry(set, &cfts[0].ss->cftsets, node) { if (set->cfts == cfts) { list_del(&set->node); kfree(set); found = cfts; break; } } cgroup_cfts_commit(found, false); cgroup_exit_cftypes(cfts); return found ? 0 : -ENOENT; } /** * cgroup_task_count - count the number of tasks in a cgroup. * @cgrp: the cgroup in question Loading