Lines Matching refs:dev_cgroup

43 struct dev_cgroup {  struct
49 static inline struct dev_cgroup *css_to_devcgroup(struct cgroup_subsys_state *s) in css_to_devcgroup() argument
51 return s ? container_of(s, struct dev_cgroup, css) : NULL; in css_to_devcgroup()
54 static inline struct dev_cgroup *task_devcgroup(struct task_struct *task) in task_devcgroup()
99 static int dev_exception_add(struct dev_cgroup *dev_cgroup, in dev_exception_add() argument
110 list_for_each_entry(walk, &dev_cgroup->exceptions, list) { in dev_exception_add()
124 list_add_tail_rcu(&excopy->list, &dev_cgroup->exceptions); in dev_exception_add()
131 static void dev_exception_rm(struct dev_cgroup *dev_cgroup, in dev_exception_rm() argument
138 list_for_each_entry_safe(walk, tmp, &dev_cgroup->exceptions, list) { in dev_exception_rm()
154 static void __dev_exception_clean(struct dev_cgroup *dev_cgroup) in __dev_exception_clean() argument
158 list_for_each_entry_safe(ex, tmp, &dev_cgroup->exceptions, list) { in __dev_exception_clean()
170 static void dev_exception_clean(struct dev_cgroup *dev_cgroup) in dev_exception_clean() argument
174 __dev_exception_clean(dev_cgroup); in dev_exception_clean()
177 static inline bool is_devcg_online(const struct dev_cgroup *devcg) in is_devcg_online()
190 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css); in devcgroup_online() local
191 struct dev_cgroup *parent_dev_cgroup = css_to_devcgroup(css->parent); in devcgroup_online()
197 dev_cgroup->behavior = DEVCG_DEFAULT_ALLOW; in devcgroup_online()
199 ret = dev_exceptions_copy(&dev_cgroup->exceptions, in devcgroup_online()
202 dev_cgroup->behavior = parent_dev_cgroup->behavior; in devcgroup_online()
211 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css); in devcgroup_offline() local
214 dev_cgroup->behavior = DEVCG_DEFAULT_NONE; in devcgroup_offline()
224 struct dev_cgroup *dev_cgroup; in devcgroup_css_alloc() local
226 dev_cgroup = kzalloc(sizeof(*dev_cgroup), GFP_KERNEL); in devcgroup_css_alloc()
227 if (!dev_cgroup) in devcgroup_css_alloc()
229 INIT_LIST_HEAD(&dev_cgroup->exceptions); in devcgroup_css_alloc()
230 dev_cgroup->behavior = DEVCG_DEFAULT_NONE; in devcgroup_css_alloc()
232 return &dev_cgroup->css; in devcgroup_css_alloc()
237 struct dev_cgroup *dev_cgroup = css_to_devcgroup(css); in devcgroup_css_free() local
239 __dev_exception_clean(dev_cgroup); in devcgroup_css_free()
240 kfree(dev_cgroup); in devcgroup_css_free()
283 struct dev_cgroup *devcgroup = css_to_devcgroup(seq_css(m)); in devcgroup_seq_show()
404 static bool verify_new_ex(struct dev_cgroup *dev_cgroup, in verify_new_ex() argument
414 if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) { in verify_new_ex()
427 match = match_exception_partial(&dev_cgroup->exceptions, in verify_new_ex()
444 match = match_exception(&dev_cgroup->exceptions, refex->type, in verify_new_ex()
462 static int parent_has_perm(struct dev_cgroup *childcg, in parent_has_perm()
465 struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent); in parent_has_perm()
483 static bool parent_allows_removal(struct dev_cgroup *childcg, in parent_allows_removal()
486 struct dev_cgroup *parent = css_to_devcgroup(childcg->css.parent); in parent_allows_removal()
509 static inline int may_allow_all(struct dev_cgroup *parent) in may_allow_all()
529 static void revalidate_active_exceptions(struct dev_cgroup *devcg) in revalidate_active_exceptions()
548 static int propagate_exception(struct dev_cgroup *devcg_root, in propagate_exception()
557 struct dev_cgroup *devcg = css_to_devcgroup(pos); in propagate_exception()
610 static int devcgroup_update_access(struct dev_cgroup *devcgroup, in devcgroup_update_access()
617 struct dev_cgroup *parent = css_to_devcgroup(devcgroup->css.parent); in devcgroup_update_access()
618 struct dev_cgroup tmp_devcgrp; in devcgroup_update_access()
835 struct dev_cgroup *dev_cgroup; in devcgroup_legacy_check_permission() local
839 dev_cgroup = task_devcgroup(current); in devcgroup_legacy_check_permission()
840 if (dev_cgroup->behavior == DEVCG_DEFAULT_ALLOW) in devcgroup_legacy_check_permission()
842 rc = !match_exception_partial(&dev_cgroup->exceptions, in devcgroup_legacy_check_permission()
846 rc = match_exception(&dev_cgroup->exceptions, type, major, in devcgroup_legacy_check_permission()