Lines Matching full:ls
593 struct aa_labelset *ls = labels_set(label); in __label_remove() local
595 AA_BUG(!ls); in __label_remove()
597 lockdep_assert_held_write(&ls->lock); in __label_remove()
606 rb_erase(&label->node, &ls->root); in __label_remove()
629 struct aa_labelset *ls = labels_set(old); in __label_replace() local
631 AA_BUG(!ls); in __label_replace()
634 lockdep_assert_held_write(&ls->lock); in __label_replace()
641 rb_replace_node(&old->node, &new->node, &ls->root); in __label_replace()
652 * @ls: set of labels to insert @l into (NOT NULL)
656 * Requires: @ls->lock
663 static struct aa_label *__label_insert(struct aa_labelset *ls, in __label_insert() argument
668 AA_BUG(!ls); in __label_insert()
670 AA_BUG(labels_set(label) != ls); in __label_insert()
671 lockdep_assert_held_write(&ls->lock); in __label_insert()
675 new = &ls->root.rb_node; in __label_insert()
702 rb_insert_color(&label->node, &ls->root); in __label_insert()
772 struct aa_labelset *ls = labels_set(label); in aa_label_remove() local
776 AA_BUG(!ls); in aa_label_remove()
778 write_lock_irqsave(&ls->lock, flags); in aa_label_remove()
780 write_unlock_irqrestore(&ls->lock, flags); in aa_label_remove()
808 struct aa_labelset *ls = labels_set(old); in aa_label_replace() local
810 write_lock_irqsave(&ls->lock, flags); in aa_label_replace()
813 write_unlock_irqrestore(&ls->lock, flags); in aa_label_replace()
814 ls = labels_set(new); in aa_label_replace()
815 write_lock_irqsave(&ls->lock, flags); in aa_label_replace()
817 l = __label_insert(ls, new, true); in aa_label_replace()
819 write_unlock_irqrestore(&ls->lock, flags); in aa_label_replace()
836 struct aa_labelset *ls; in vec_find() local
844 ls = vec_labelset(vec, n); in vec_find()
845 read_lock_irqsave(&ls->lock, flags); in vec_find()
847 read_unlock_irqrestore(&ls->lock, flags); in vec_find()
857 struct aa_labelset *ls; in vec_create_and_insert_label() local
867 ls = labels_set(&vec[len - 1]->label); in vec_create_and_insert_label()
879 write_lock_irqsave(&ls->lock, flags); in vec_create_and_insert_label()
880 label = __label_insert(ls, new, false); in vec_create_and_insert_label()
881 write_unlock_irqrestore(&ls->lock, flags); in vec_create_and_insert_label()
917 * aa_label_insert - insert label @label into @ls or return existing label
918 * @ls - labelset to insert @label into
926 struct aa_label *aa_label_insert(struct aa_labelset *ls, struct aa_label *label) in aa_label_insert() argument
931 AA_BUG(!ls); in aa_label_insert()
936 read_lock_irqsave(&ls->lock, flags); in aa_label_insert()
938 read_unlock_irqrestore(&ls->lock, flags); in aa_label_insert()
943 write_lock_irqsave(&ls->lock, flags); in aa_label_insert()
944 l = __label_insert(ls, label, false); in aa_label_insert()
945 write_unlock_irqrestore(&ls->lock, flags); in aa_label_insert()
1052 struct aa_labelset *ls; in label_merge_insert() local
1103 ls = labels_set(new); in label_merge_insert()
1104 write_lock_irqsave(&ls->lock, flags); in label_merge_insert()
1106 write_unlock_irqrestore(&ls->lock, flags); in label_merge_insert()
1131 * @ls: set of labels to search (NOT NULL)
1135 * Requires: ls->lock read_lock held
1140 static struct aa_label *__label_find_merge(struct aa_labelset *ls, in __label_find_merge() argument
1146 AA_BUG(!ls); in __label_find_merge()
1153 node = ls->root.rb_node; in __label_find_merge()
1183 struct aa_labelset *ls; in aa_label_find_merge() local
1194 ls = labelset_of_merge(a, b); in aa_label_find_merge()
1195 read_lock_irqsave(&ls->lock, flags); in aa_label_find_merge()
1196 label = __label_find_merge(ls, a, b); in aa_label_find_merge()
1197 read_unlock_irqrestore(&ls->lock, flags); in aa_label_find_merge()
1206 * @ls: set of labels to insert label into (NOT NULL)
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()
1975 * @ls: label set to cleanup (NOT NULL)
1980 void aa_labelset_destroy(struct aa_labelset *ls) in aa_labelset_destroy() argument
1985 AA_BUG(!ls); in aa_labelset_destroy()
1987 write_lock_irqsave(&ls->lock, flags); in aa_labelset_destroy()
1988 for (node = rb_first(&ls->root); node; node = rb_first(&ls->root)) { in aa_labelset_destroy()
1997 write_unlock_irqrestore(&ls->lock, flags); in aa_labelset_destroy()
2001 * @ls: labelset to init (NOT NULL)
2003 void aa_labelset_init(struct aa_labelset *ls) in aa_labelset_init() argument
2005 AA_BUG(!ls); in aa_labelset_init()
2007 rwlock_init(&ls->lock); in aa_labelset_init()
2008 ls->root = RB_ROOT; in aa_labelset_init()
2011 static struct aa_label *labelset_next_stale(struct aa_labelset *ls) in labelset_next_stale() argument
2017 AA_BUG(!ls); in labelset_next_stale()
2019 read_lock_irqsave(&ls->lock, flags); in labelset_next_stale()
2021 __labelset_for_each(ls, node) { in labelset_next_stale()
2032 read_unlock_irqrestore(&ls->lock, flags); in labelset_next_stale()
2052 struct aa_labelset *ls; in __label_update() local
2067 ls = labels_set(label); in __label_update()
2068 write_lock_irqsave(&ls->lock, flags); in __label_update()
2090 write_unlock_irqrestore(&ls->lock, flags); in __label_update()
2092 write_lock_irqsave(&ls->lock, flags); in __label_update()
2102 write_unlock_irqrestore(&ls->lock, flags); in __label_update()