Lines Matching refs:ls

595 	struct aa_labelset *ls = labels_set(label);  in __label_remove()  local
597 AA_BUG(!ls); in __label_remove()
599 lockdep_assert_held_write(&ls->lock); in __label_remove()
608 rb_erase(&label->node, &ls->root); in __label_remove()
631 struct aa_labelset *ls = labels_set(old); in __label_replace() local
633 AA_BUG(!ls); in __label_replace()
636 lockdep_assert_held_write(&ls->lock); in __label_replace()
643 rb_replace_node(&old->node, &new->node, &ls->root); in __label_replace()
665 static struct aa_label *__label_insert(struct aa_labelset *ls, in __label_insert() argument
670 AA_BUG(!ls); in __label_insert()
672 AA_BUG(labels_set(label) != ls); in __label_insert()
673 lockdep_assert_held_write(&ls->lock); in __label_insert()
677 new = &ls->root.rb_node; in __label_insert()
704 rb_insert_color(&label->node, &ls->root); in __label_insert()
774 struct aa_labelset *ls = labels_set(label); in aa_label_remove() local
778 AA_BUG(!ls); in aa_label_remove()
780 write_lock_irqsave(&ls->lock, flags); in aa_label_remove()
782 write_unlock_irqrestore(&ls->lock, flags); in aa_label_remove()
810 struct aa_labelset *ls = labels_set(old); in aa_label_replace() local
812 write_lock_irqsave(&ls->lock, flags); in aa_label_replace()
815 write_unlock_irqrestore(&ls->lock, flags); in aa_label_replace()
816 ls = labels_set(new); in aa_label_replace()
817 write_lock_irqsave(&ls->lock, flags); in aa_label_replace()
819 l = __label_insert(ls, new, true); in aa_label_replace()
821 write_unlock_irqrestore(&ls->lock, flags); in aa_label_replace()
838 struct aa_labelset *ls; in vec_find() local
846 ls = vec_labelset(vec, n); in vec_find()
847 read_lock_irqsave(&ls->lock, flags); in vec_find()
849 read_unlock_irqrestore(&ls->lock, flags); in vec_find()
859 struct aa_labelset *ls; in vec_create_and_insert_label() local
869 ls = labels_set(&vec[len - 1]->label); in vec_create_and_insert_label()
881 write_lock_irqsave(&ls->lock, flags); in vec_create_and_insert_label()
882 label = __label_insert(ls, new, false); in vec_create_and_insert_label()
883 write_unlock_irqrestore(&ls->lock, flags); in vec_create_and_insert_label()
928 struct aa_label *aa_label_insert(struct aa_labelset *ls, struct aa_label *label) in aa_label_insert() argument
933 AA_BUG(!ls); in aa_label_insert()
938 read_lock_irqsave(&ls->lock, flags); in aa_label_insert()
940 read_unlock_irqrestore(&ls->lock, flags); in aa_label_insert()
945 write_lock_irqsave(&ls->lock, flags); in aa_label_insert()
946 l = __label_insert(ls, label, false); in aa_label_insert()
947 write_unlock_irqrestore(&ls->lock, flags); in aa_label_insert()
1054 struct aa_labelset *ls; in label_merge_insert() local
1104 ls = labels_set(new); in label_merge_insert()
1105 write_lock_irqsave(&ls->lock, flags); in label_merge_insert()
1107 write_unlock_irqrestore(&ls->lock, flags); in label_merge_insert()
1141 static struct aa_label *__label_find_merge(struct aa_labelset *ls, in __label_find_merge() argument
1147 AA_BUG(!ls); in __label_find_merge()
1154 node = ls->root.rb_node; in __label_find_merge()
1184 struct aa_labelset *ls; in aa_label_find_merge() local
1195 ls = labelset_of_merge(a, b); in aa_label_find_merge()
1196 read_lock_irqsave(&ls->lock, flags); in aa_label_find_merge()
1197 label = __label_find_merge(ls, a, b); in aa_label_find_merge()
1198 read_unlock_irqrestore(&ls->lock, flags); in aa_label_find_merge()
1446 struct aa_labelset *ls; in aa_update_label_name() local
1460 ls = labels_set(label); in aa_update_label_name()
1461 write_lock_irqsave(&ls->lock, flags); in aa_update_label_name()
1467 write_unlock_irqrestore(&ls->lock, flags); in aa_update_label_name()
1981 void aa_labelset_destroy(struct aa_labelset *ls) in aa_labelset_destroy() argument
1986 AA_BUG(!ls); in aa_labelset_destroy()
1988 write_lock_irqsave(&ls->lock, flags); in aa_labelset_destroy()
1989 for (node = rb_first(&ls->root); node; node = rb_first(&ls->root)) { in aa_labelset_destroy()
1998 write_unlock_irqrestore(&ls->lock, flags); in aa_labelset_destroy()
2004 void aa_labelset_init(struct aa_labelset *ls) in aa_labelset_init() argument
2006 AA_BUG(!ls); in aa_labelset_init()
2008 rwlock_init(&ls->lock); in aa_labelset_init()
2009 ls->root = RB_ROOT; in aa_labelset_init()
2012 static struct aa_label *labelset_next_stale(struct aa_labelset *ls) in labelset_next_stale() argument
2018 AA_BUG(!ls); in labelset_next_stale()
2020 read_lock_irqsave(&ls->lock, flags); in labelset_next_stale()
2022 __labelset_for_each(ls, node) { in labelset_next_stale()
2033 read_unlock_irqrestore(&ls->lock, flags); in labelset_next_stale()
2053 struct aa_labelset *ls; in __label_update() local
2068 ls = labels_set(label); in __label_update()
2069 write_lock_irqsave(&ls->lock, flags); in __label_update()
2091 write_unlock_irqrestore(&ls->lock, flags); in __label_update()
2093 write_lock_irqsave(&ls->lock, flags); in __label_update()
2103 write_unlock_irqrestore(&ls->lock, flags); in __label_update()