Lines Matching refs:ex

69 	struct dev_exception_item *ex, *tmp, *new;  in dev_exceptions_copy()  local
73 list_for_each_entry(ex, orig, list) { in dev_exceptions_copy()
74 new = kmemdup(ex, sizeof(*ex), GFP_KERNEL); in dev_exceptions_copy()
83 list_for_each_entry_safe(ex, tmp, dest, list) { in dev_exceptions_copy()
84 list_del(&ex->list); in dev_exceptions_copy()
85 kfree(ex); in dev_exceptions_copy()
94 struct dev_exception_item *ex) in dev_exception_add() argument
100 excopy = kmemdup(ex, sizeof(*ex), GFP_KERNEL); in dev_exception_add()
105 if (walk->type != ex->type) in dev_exception_add()
107 if (walk->major != ex->major) in dev_exception_add()
109 if (walk->minor != ex->minor) in dev_exception_add()
112 walk->access |= ex->access; in dev_exception_add()
126 struct dev_exception_item *ex) in dev_exception_rm() argument
133 if (walk->type != ex->type) in dev_exception_rm()
135 if (walk->major != ex->major) in dev_exception_rm()
137 if (walk->minor != ex->minor) in dev_exception_rm()
140 walk->access &= ~ex->access; in dev_exception_rm()
150 struct dev_exception_item *ex, *tmp; in __dev_exception_clean() local
152 list_for_each_entry_safe(ex, tmp, &dev_cgroup->exceptions, list) { in __dev_exception_clean()
153 list_del_rcu(&ex->list); in __dev_exception_clean()
154 kfree_rcu(ex, rcu); in __dev_exception_clean()
278 struct dev_exception_item *ex; in devcgroup_seq_show() local
295 list_for_each_entry_rcu(ex, &devcgroup->exceptions, list) { in devcgroup_seq_show()
296 set_access(acc, ex->access); in devcgroup_seq_show()
297 set_majmin(maj, ex->major); in devcgroup_seq_show()
298 set_majmin(min, ex->minor); in devcgroup_seq_show()
299 seq_printf(m, "%c %s:%s %s\n", type_to_char(ex->type), 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 & DEV_BLOCK) && !(ex->type & DEV_BLOCK)) in match_exception()
329 if ((type & DEV_CHAR) && !(ex->type & 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()
364 if ((type & DEV_BLOCK) && !(ex->type & DEV_BLOCK)) in match_exception_partial()
366 if ((type & DEV_CHAR) && !(ex->type & DEV_CHAR)) in match_exception_partial()
372 if (ex->major != ~0 && major != ~0 && ex->major != major) in match_exception_partial()
374 if (ex->minor != ~0 && minor != ~0 && ex->minor != minor) in match_exception_partial()
381 if (!(access & ex->access)) in match_exception_partial()
456 struct dev_exception_item *ex) in parent_has_perm() argument
462 return verify_new_ex(parent, ex, childcg->behavior); in parent_has_perm()
477 struct dev_exception_item *ex) in parent_allows_removal() argument
492 return !match_exception_partial(&parent->exceptions, ex->type, in parent_allows_removal()
493 ex->major, ex->minor, ex->access); in parent_allows_removal()
524 struct dev_exception_item *ex; in revalidate_active_exceptions() local
528 ex = container_of(this, struct dev_exception_item, list); in revalidate_active_exceptions()
529 if (!parent_has_perm(devcg, ex)) in revalidate_active_exceptions()
530 dev_exception_rm(devcg, ex); in revalidate_active_exceptions()
542 struct dev_exception_item *ex) in propagate_exception() argument
569 rc = dev_exception_add(devcg, ex); in propagate_exception()
579 dev_exception_rm(devcg, ex); in propagate_exception()
609 struct dev_exception_item ex; in devcgroup_update_access() local
615 memset(&ex, 0, sizeof(ex)); in devcgroup_update_access()
649 ex.type = DEV_BLOCK; in devcgroup_update_access()
652 ex.type = DEV_CHAR; in devcgroup_update_access()
662 ex.major = ~0; in devcgroup_update_access()
672 rc = kstrtou32(temp, 10, &ex.major); in devcgroup_update_access()
684 ex.minor = ~0; in devcgroup_update_access()
694 rc = kstrtou32(temp, 10, &ex.minor); in devcgroup_update_access()
705 ex.access |= ACC_READ; in devcgroup_update_access()
708 ex.access |= ACC_WRITE; in devcgroup_update_access()
711 ex.access |= ACC_MKNOD; in devcgroup_update_access()
731 if (!parent_allows_removal(devcgroup, &ex)) in devcgroup_update_access()
733 dev_exception_rm(devcgroup, &ex); in devcgroup_update_access()
737 if (!parent_has_perm(devcgroup, &ex)) in devcgroup_update_access()
739 rc = dev_exception_add(devcgroup, &ex); in devcgroup_update_access()
748 dev_exception_rm(devcgroup, &ex); in devcgroup_update_access()
750 rc = dev_exception_add(devcgroup, &ex); in devcgroup_update_access()
755 rc = propagate_exception(devcgroup, &ex); in devcgroup_update_access()