Lines Matching refs:ex

61 	struct dev_exception_item *ex, *tmp, *new;  in dev_exceptions_copy()  local
65 list_for_each_entry(ex, orig, list) { in dev_exceptions_copy()
66 new = kmemdup(ex, sizeof(*ex), GFP_KERNEL); in dev_exceptions_copy()
75 list_for_each_entry_safe(ex, tmp, dest, list) { in dev_exceptions_copy()
76 list_del(&ex->list); in dev_exceptions_copy()
77 kfree(ex); in dev_exceptions_copy()
86 struct dev_exception_item *ex) in dev_exception_add() argument
92 excopy = kmemdup(ex, sizeof(*ex), GFP_KERNEL); in dev_exception_add()
97 if (walk->type != ex->type) in dev_exception_add()
99 if (walk->major != ex->major) in dev_exception_add()
101 if (walk->minor != ex->minor) in dev_exception_add()
104 walk->access |= ex->access; in dev_exception_add()
118 struct dev_exception_item *ex) in dev_exception_rm() argument
125 if (walk->type != ex->type) in dev_exception_rm()
127 if (walk->major != ex->major) in dev_exception_rm()
129 if (walk->minor != ex->minor) in dev_exception_rm()
132 walk->access &= ~ex->access; in dev_exception_rm()
142 struct dev_exception_item *ex, *tmp; in __dev_exception_clean() local
144 list_for_each_entry_safe(ex, tmp, &dev_cgroup->exceptions, list) { in __dev_exception_clean()
145 list_del_rcu(&ex->list); in __dev_exception_clean()
146 kfree_rcu(ex, rcu); in __dev_exception_clean()
270 struct dev_exception_item *ex; in devcgroup_seq_show() local
287 list_for_each_entry_rcu(ex, &devcgroup->exceptions, list) { in devcgroup_seq_show()
288 set_access(acc, ex->access); in devcgroup_seq_show()
289 set_majmin(maj, ex->major); in devcgroup_seq_show()
290 set_majmin(min, ex->minor); in devcgroup_seq_show()
291 seq_printf(m, "%c %s:%s %s\n", type_to_char(ex->type), in devcgroup_seq_show()
316 struct dev_exception_item *ex; in match_exception() local
318 list_for_each_entry_rcu(ex, exceptions, list) { in match_exception()
319 if ((type & DEVCG_DEV_BLOCK) && !(ex->type & DEVCG_DEV_BLOCK)) in match_exception()
321 if ((type & DEVCG_DEV_CHAR) && !(ex->type & DEVCG_DEV_CHAR)) in match_exception()
323 if (ex->major != ~0 && ex->major != major) in match_exception()
325 if (ex->minor != ~0 && ex->minor != minor) in match_exception()
328 if (access & (~ex->access)) in match_exception()
353 struct dev_exception_item *ex; in match_exception_partial() local
355 list_for_each_entry_rcu(ex, exceptions, list) { in match_exception_partial()
356 if ((type & DEVCG_DEV_BLOCK) && !(ex->type & DEVCG_DEV_BLOCK)) in match_exception_partial()
358 if ((type & DEVCG_DEV_CHAR) && !(ex->type & DEVCG_DEV_CHAR)) in match_exception_partial()
364 if (ex->major != ~0 && major != ~0 && ex->major != major) in match_exception_partial()
366 if (ex->minor != ~0 && minor != ~0 && ex->minor != minor) in match_exception_partial()
373 if (!(access & ex->access)) in match_exception_partial()
448 struct dev_exception_item *ex) in parent_has_perm() argument
454 return verify_new_ex(parent, ex, childcg->behavior); in parent_has_perm()
469 struct dev_exception_item *ex) in parent_allows_removal() argument
484 return !match_exception_partial(&parent->exceptions, ex->type, in parent_allows_removal()
485 ex->major, ex->minor, ex->access); in parent_allows_removal()
516 struct dev_exception_item *ex; in revalidate_active_exceptions() local
520 ex = container_of(this, struct dev_exception_item, list); in revalidate_active_exceptions()
521 if (!parent_has_perm(devcg, ex)) in revalidate_active_exceptions()
522 dev_exception_rm(devcg, ex); in revalidate_active_exceptions()
534 struct dev_exception_item *ex) in propagate_exception() argument
561 rc = dev_exception_add(devcg, ex); in propagate_exception()
571 dev_exception_rm(devcg, ex); in propagate_exception()
601 struct dev_exception_item ex; in devcgroup_update_access() local
607 memset(&ex, 0, sizeof(ex)); in devcgroup_update_access()
641 ex.type = DEVCG_DEV_BLOCK; in devcgroup_update_access()
644 ex.type = DEVCG_DEV_CHAR; in devcgroup_update_access()
654 ex.major = ~0; in devcgroup_update_access()
664 rc = kstrtou32(temp, 10, &ex.major); in devcgroup_update_access()
676 ex.minor = ~0; in devcgroup_update_access()
686 rc = kstrtou32(temp, 10, &ex.minor); in devcgroup_update_access()
697 ex.access |= DEVCG_ACC_READ; in devcgroup_update_access()
700 ex.access |= DEVCG_ACC_WRITE; in devcgroup_update_access()
703 ex.access |= DEVCG_ACC_MKNOD; in devcgroup_update_access()
723 if (!parent_allows_removal(devcgroup, &ex)) in devcgroup_update_access()
725 dev_exception_rm(devcgroup, &ex); in devcgroup_update_access()
729 if (!parent_has_perm(devcgroup, &ex)) in devcgroup_update_access()
731 rc = dev_exception_add(devcgroup, &ex); in devcgroup_update_access()
740 dev_exception_rm(devcgroup, &ex); in devcgroup_update_access()
742 rc = dev_exception_add(devcgroup, &ex); in devcgroup_update_access()
747 rc = propagate_exception(devcgroup, &ex); in devcgroup_update_access()