Lines Matching defs:dev_cgroup

43 struct dev_cgroup {
49 static inline struct dev_cgroup *css_to_devcgroup(struct cgroup_subsys_state *s)
51 return s ? container_of(s, struct dev_cgroup, css) : NULL;
54 static inline struct dev_cgroup *task_devcgroup(struct task_struct *task)
99 static int dev_exception_add(struct dev_cgroup *dev_cgroup,
110 list_for_each_entry(walk, &dev_cgroup->exceptions, list) {
124 list_add_tail_rcu(&excopy->list, &dev_cgroup->exceptions);
131 static void dev_exception_rm(struct dev_cgroup *dev_cgroup,
138 list_for_each_entry_safe(walk, tmp, &dev_cgroup->exceptions, list) {
154 static void __dev_exception_clean(struct dev_cgroup *dev_cgroup)
158 list_for_each_entry_safe(ex, tmp, &dev_cgroup->exceptions, list) {
166 * @dev_cgroup: dev_cgroup with the exception list to be cleaned
170 static void dev_exception_clean(struct dev_cgroup *dev_cgroup)
174 __dev_exception_clean(dev_cgroup);
177 static inline bool is_devcg_online(const struct dev_cgroup *devcg)
190 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css);
191 struct dev_cgroup *parent_dev_cgroup = css_to_devcgroup(css->parent);
197 dev_cgroup->behavior = DEVCG_DEFAULT_ALLOW;
199 ret = dev_exceptions_copy(&dev_cgroup->exceptions,
202 dev_cgroup->behavior = parent_dev_cgroup->behavior;
211 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css);
214 dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
224 struct dev_cgroup *dev_cgroup;
226 dev_cgroup = kzalloc(sizeof(*dev_cgroup), GFP_KERNEL);
227 if (!dev_cgroup)
229 INIT_LIST_HEAD(&dev_cgroup->exceptions);
230 dev_cgroup->behavior = DEVCG_DEFAULT_NONE;
232 return &dev_cgroup->css;
237 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css);
239 __dev_exception_clean(dev_cgroup);
240 kfree(dev_cgroup);
283 struct dev_cgroup *devcgroup = css_to_devcgroup(seq_css(m));
397 * @dev_cgroup: dev cgroup to be tested against
399 * @behavior: behavior of the exception's dev_cgroup
404 static bool verify_new_ex(struct dev_cgroup *dev_cgroup,
414 if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) {
427 match = match_exception_partial(&dev_cgroup->exceptions,
444 match = match_exception(&dev_cgroup->exceptions, refex->type,
462 static int parent_has_perm(struct dev_cgroup *childcg,
465 struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent);
483 static bool parent_allows_removal(struct dev_cgroup *childcg,
486 struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent);
509 static inline int may_allow_all(struct dev_cgroup *parent)
529 static void revalidate_active_exceptions(struct dev_cgroup *devcg)
548 static int propagate_exception(struct dev_cgroup *devcg_root,
557 struct dev_cgroup *devcg = css_to_devcgroup(pos);
610 static int devcgroup_update_access(struct dev_cgroup *devcgroup,
617 struct dev_cgroup *parent = css_to_devcgroup(devcgroup->css.parent);
618 struct dev_cgroup tmp_devcgrp;
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,