Lines Matching refs:ex
64 struct dev_exception_item *ex, *tmp, *new; in dev_exceptions_copy() local
68 list_for_each_entry(ex, orig, list) { in dev_exceptions_copy()
69 new = kmemdup(ex, sizeof(*ex), GFP_KERNEL); in dev_exceptions_copy()
78 list_for_each_entry_safe(ex, tmp, dest, list) { in dev_exceptions_copy()
79 list_del(&ex->list); in dev_exceptions_copy()
80 kfree(ex); in dev_exceptions_copy()
87 struct dev_exception_item *ex, *tmp; in dev_exceptions_move() local
91 list_for_each_entry_safe(ex, tmp, orig, list) { in dev_exceptions_move()
92 list_move_tail(&ex->list, dest); in dev_exceptions_move()
100 struct dev_exception_item *ex) in dev_exception_add() argument
106 excopy = kmemdup(ex, sizeof(*ex), GFP_KERNEL); in dev_exception_add()
111 if (walk->type != ex->type) in dev_exception_add()
113 if (walk->major != ex->major) in dev_exception_add()
115 if (walk->minor != ex->minor) in dev_exception_add()
118 walk->access |= ex->access; in dev_exception_add()
132 struct dev_exception_item *ex) in dev_exception_rm() argument
139 if (walk->type != ex->type) in dev_exception_rm()
141 if (walk->major != ex->major) in dev_exception_rm()
143 if (walk->minor != ex->minor) in dev_exception_rm()
146 walk->access &= ~ex->access; in dev_exception_rm()
156 struct dev_exception_item *ex, *tmp; in __dev_exception_clean() local
158 list_for_each_entry_safe(ex, tmp, &dev_cgroup->exceptions, list) { in __dev_exception_clean()
159 list_del_rcu(&ex->list); in __dev_exception_clean()
160 kfree_rcu(ex, rcu); in __dev_exception_clean()
280 struct dev_exception_item *ex; in devcgroup_seq_show() local
292 list_for_each_entry_rcu(ex, &devcgroup->exceptions, list) { in devcgroup_seq_show()
293 seq_puttype(m, ex->type); in devcgroup_seq_show()
295 seq_putversion(m, ex->major); in devcgroup_seq_show()
297 seq_putversion(m, ex->minor); in devcgroup_seq_show()
299 seq_putaccess(m, ex->access); in devcgroup_seq_show()
324 struct dev_exception_item *ex; in match_exception() local
326 list_for_each_entry_rcu(ex, exceptions, list) { in match_exception()
327 if ((type & DEVCG_DEV_BLOCK) && !(ex->type & DEVCG_DEV_BLOCK)) in match_exception()
329 if ((type & DEVCG_DEV_CHAR) && !(ex->type & DEVCG_DEV_CHAR)) in match_exception()
331 if (ex->major != ~0 && ex->major != major) in match_exception()
333 if (ex->minor != ~0 && ex->minor != minor) in match_exception()
336 if (access & (~ex->access)) in match_exception()
361 struct dev_exception_item *ex; in match_exception_partial() local
363 list_for_each_entry_rcu(ex, exceptions, list, in match_exception_partial()
365 if ((type & DEVCG_DEV_BLOCK) && !(ex->type & DEVCG_DEV_BLOCK)) in match_exception_partial()
367 if ((type & DEVCG_DEV_CHAR) && !(ex->type & DEVCG_DEV_CHAR)) in match_exception_partial()
373 if (ex->major != ~0 && major != ~0 && ex->major != major) in match_exception_partial()
375 if (ex->minor != ~0 && minor != ~0 && ex->minor != minor) in match_exception_partial()
382 if (!(access & ex->access)) in match_exception_partial()
457 struct dev_exception_item *ex) in parent_has_perm() argument
463 return verify_new_ex(parent, ex, childcg->behavior); in parent_has_perm()
478 struct dev_exception_item *ex) in parent_allows_removal() argument
493 return !match_exception_partial(&parent->exceptions, ex->type, in parent_allows_removal()
494 ex->major, ex->minor, ex->access); in parent_allows_removal()
525 struct dev_exception_item *ex; in revalidate_active_exceptions() local
529 ex = container_of(this, struct dev_exception_item, list); in revalidate_active_exceptions()
530 if (!parent_has_perm(devcg, ex)) in revalidate_active_exceptions()
531 dev_exception_rm(devcg, ex); in revalidate_active_exceptions()
543 struct dev_exception_item *ex) in propagate_exception() argument
570 rc = dev_exception_add(devcg, ex); in propagate_exception()
580 dev_exception_rm(devcg, ex); in propagate_exception()
610 struct dev_exception_item ex; in devcgroup_update_access() local
617 memset(&ex, 0, sizeof(ex)); in devcgroup_update_access()
664 ex.type = DEVCG_DEV_BLOCK; in devcgroup_update_access()
667 ex.type = DEVCG_DEV_CHAR; in devcgroup_update_access()
677 ex.major = ~0; in devcgroup_update_access()
687 rc = kstrtou32(temp, 10, &ex.major); in devcgroup_update_access()
699 ex.minor = ~0; in devcgroup_update_access()
709 rc = kstrtou32(temp, 10, &ex.minor); in devcgroup_update_access()
720 ex.access |= DEVCG_ACC_READ; in devcgroup_update_access()
723 ex.access |= DEVCG_ACC_WRITE; in devcgroup_update_access()
726 ex.access |= DEVCG_ACC_MKNOD; in devcgroup_update_access()
746 if (!parent_allows_removal(devcgroup, &ex)) in devcgroup_update_access()
748 dev_exception_rm(devcgroup, &ex); in devcgroup_update_access()
752 if (!parent_has_perm(devcgroup, &ex)) in devcgroup_update_access()
754 rc = dev_exception_add(devcgroup, &ex); in devcgroup_update_access()
763 dev_exception_rm(devcgroup, &ex); in devcgroup_update_access()
765 rc = dev_exception_add(devcgroup, &ex); in devcgroup_update_access()
770 rc = propagate_exception(devcgroup, &ex); in devcgroup_update_access()