Lines Matching defs:ls

597 	struct aa_labelset *ls = labels_set(label);
599 AA_BUG(!ls);
601 lockdep_assert_held_write(&ls->lock);
610 rb_erase(&label->node, &ls->root);
633 struct aa_labelset *ls = labels_set(old);
635 AA_BUG(!ls);
638 lockdep_assert_held_write(&ls->lock);
645 rb_replace_node(&old->node, &new->node, &ls->root);
656 * @ls: set of labels to insert @l into (NOT NULL)
660 * Requires: @ls->lock
667 static struct aa_label *__label_insert(struct aa_labelset *ls,
672 AA_BUG(!ls);
674 AA_BUG(labels_set(label) != ls);
675 lockdep_assert_held_write(&ls->lock);
679 new = &ls->root.rb_node;
706 rb_insert_color(&label->node, &ls->root);
776 struct aa_labelset *ls = labels_set(label);
780 AA_BUG(!ls);
782 write_lock_irqsave(&ls->lock, flags);
784 write_unlock_irqrestore(&ls->lock, flags);
812 struct aa_labelset *ls = labels_set(old);
814 write_lock_irqsave(&ls->lock, flags);
817 write_unlock_irqrestore(&ls->lock, flags);
818 ls = labels_set(new);
819 write_lock_irqsave(&ls->lock, flags);
821 l = __label_insert(ls, new, true);
823 write_unlock_irqrestore(&ls->lock, flags);
840 struct aa_labelset *ls;
848 ls = vec_labelset(vec, n);
849 read_lock_irqsave(&ls->lock, flags);
851 read_unlock_irqrestore(&ls->lock, flags);
861 struct aa_labelset *ls;
871 ls = labels_set(&vec[len - 1]->label);
883 write_lock_irqsave(&ls->lock, flags);
884 label = __label_insert(ls, new, false);
885 write_unlock_irqrestore(&ls->lock, flags);
904 * aa_label_insert - insert label @label into @ls or return existing label
905 * @ls: labelset to insert @label into
913 struct aa_label *aa_label_insert(struct aa_labelset *ls, struct aa_label *label)
918 AA_BUG(!ls);
923 read_lock_irqsave(&ls->lock, flags);
925 read_unlock_irqrestore(&ls->lock, flags);
930 write_lock_irqsave(&ls->lock, flags);
931 l = __label_insert(ls, label, false);
932 write_unlock_irqrestore(&ls->lock, flags);
1039 struct aa_labelset *ls;
1089 ls = labels_set(new);
1090 write_lock_irqsave(&ls->lock, flags);
1092 write_unlock_irqrestore(&ls->lock, flags);
1117 * @ls: set of labels to search (NOT NULL)
1121 * Requires: ls->lock read_lock held
1126 static struct aa_label *__label_find_merge(struct aa_labelset *ls,
1132 AA_BUG(!ls);
1139 node = ls->root.rb_node;
1169 struct aa_labelset *ls;
1180 ls = labelset_of_merge(a, b);
1181 read_lock_irqsave(&ls->lock, flags);
1182 label = __label_find_merge(ls, a, b);
1183 read_unlock_irqrestore(&ls->lock, flags);
1431 struct aa_labelset *ls;
1445 ls = labels_set(label);
1446 write_lock_irqsave(&ls->lock, flags);
1452 write_unlock_irqrestore(&ls->lock, flags);
1945 * @ls: label set to cleanup (NOT NULL)
1950 void aa_labelset_destroy(struct aa_labelset *ls)
1955 AA_BUG(!ls);
1957 write_lock_irqsave(&ls->lock, flags);
1958 for (node = rb_first(&ls->root); node; node = rb_first(&ls->root)) {
1967 write_unlock_irqrestore(&ls->lock, flags);
1971 * @ls: labelset to init (NOT NULL)
1973 void aa_labelset_init(struct aa_labelset *ls)
1975 AA_BUG(!ls);
1977 rwlock_init(&ls->lock);
1978 ls->root = RB_ROOT;
1981 static struct aa_label *labelset_next_stale(struct aa_labelset *ls)
1987 AA_BUG(!ls);
1989 read_lock_irqsave(&ls->lock, flags);
1991 __labelset_for_each(ls, node) {
2002 read_unlock_irqrestore(&ls->lock, flags);
2022 struct aa_labelset *ls;
2037 ls = labels_set(label);
2038 write_lock_irqsave(&ls->lock, flags);
2060 write_unlock_irqrestore(&ls->lock, flags);
2062 write_lock_irqsave(&ls->lock, flags);
2072 write_unlock_irqrestore(&ls->lock, flags);