Lines Matching defs:dev_cgroup
42 struct dev_cgroup {
48 static inline struct dev_cgroup *css_to_devcgroup(struct cgroup_subsys_state *s)
50 return s ? container_of(s, struct dev_cgroup, css) : NULL;
53 static inline struct dev_cgroup *task_devcgroup(struct task_struct *task)
98 static int dev_exception_add(struct dev_cgroup *dev_cgroup,
109 list_for_each_entry(walk, &dev_cgroup->exceptions, list) {
123 list_add_tail_rcu(&excopy->list, &dev_cgroup->exceptions);
130 static void dev_exception_rm(struct dev_cgroup *dev_cgroup,
137 list_for_each_entry_safe(walk, tmp, &dev_cgroup->exceptions, list) {
153 static void __dev_exception_clean(struct dev_cgroup *dev_cgroup)
157 list_for_each_entry_safe(ex, tmp, &dev_cgroup->exceptions, list) {
165 * @dev_cgroup: dev_cgroup with the exception list to be cleaned
169 static void dev_exception_clean(struct dev_cgroup *dev_cgroup)
173 __dev_exception_clean(dev_cgroup);
176 static inline bool is_devcg_online(const struct dev_cgroup *devcg)
189 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css);
190 struct dev_cgroup *parent_dev_cgroup = css_to_devcgroup(css->parent);
196 dev_cgroup->behavior = DEVCG_DEFAULT_ALLOW;
198 ret = dev_exceptions_copy(&dev_cgroup->exceptions,
201 dev_cgroup->behavior = parent_dev_cgroup->behavior;
210 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css);
213 dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
223 struct dev_cgroup *dev_cgroup;
225 dev_cgroup = kzalloc(sizeof(*dev_cgroup), GFP_KERNEL);
226 if (!dev_cgroup)
228 INIT_LIST_HEAD(&dev_cgroup->exceptions);
229 dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
231 return &dev_cgroup->css;
236 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css);
238 __dev_exception_clean(dev_cgroup);
239 kfree(dev_cgroup);
282 struct dev_cgroup *devcgroup = css_to_devcgroup(seq_css(m));
396 * @dev_cgroup: dev cgroup to be tested against
398 * @behavior: behavior of the exception's dev_cgroup
403 static bool verify_new_ex(struct dev_cgroup *dev_cgroup,
413 if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) {
426 match = match_exception_partial(&dev_cgroup->exceptions,
443 match = match_exception(&dev_cgroup->exceptions, refex->type,
461 static int parent_has_perm(struct dev_cgroup *childcg,
464 struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent);
482 static bool parent_allows_removal(struct dev_cgroup *childcg,
485 struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent);
508 static inline int may_allow_all(struct dev_cgroup *parent)
528 static void revalidate_active_exceptions(struct dev_cgroup *devcg)
547 static int propagate_exception(struct dev_cgroup *devcg_root,
556 struct dev_cgroup *devcg = css_to_devcgroup(pos);
609 static int devcgroup_update_access(struct dev_cgroup *devcgroup,
616 struct dev_cgroup *parent = css_to_devcgroup(devcgroup->css.parent);
617 struct dev_cgroup tmp_devcgrp;
824 * @dev_cgroup: the dev cgroup to be tested against
835 struct dev_cgroup *dev_cgroup;
839 dev_cgroup = task_devcgroup(current);
840 if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW)
842 rc = !match_exception_partial(&dev_cgroup->exceptions,
846 rc = match_exception(&dev_cgroup->exceptions, type, major,