Lines Matching defs:instance

120 #define	LI_RECURSEMASK	0x0000ffff	/* Recursion depth of lock instance. */
121 #define LI_EXCLUSIVE 0x00010000 /* Exclusive lock instance. */
201 * Lock instances. A lock instance is the data associated with a lock while
202 * it is held by witness. For example, a lock instance will hold the
370 static void witness_list_lock(struct lock_instance *instance,
1101 struct lock_instance *instance;
1128 instance = find_instance(*lock_list, lock);
1129 if (instance != NULL) {
1130 instance->li_flags++;
1136 /* Find the next open lock instance in the list and fill it. */
1145 instance = &lle->ll_children[lle->ll_count++];
1146 instance->li_lock = lock;
1148 instance->li_flags = LI_EXCLUSIVE;
1150 instance->li_flags = 0;
1151 instance->li_stack = NULL;
1153 instance->li_stack = witness_lock_stack_get();
1154 if (instance->li_stack != NULL)
1155 stacktrace_save(&instance->li_stack->ls_stack);
1164 struct lock_instance *instance;
1182 instance = find_instance(curproc->p_sleeplocks, lock);
1183 if (instance == NULL) {
1189 if ((instance->li_flags & LI_EXCLUSIVE) != 0)
1192 if ((instance->li_flags & LI_RECURSEMASK) != 0)
1195 instance->li_flags & LI_RECURSEMASK);
1197 instance->li_flags |= LI_EXCLUSIVE;
1205 struct lock_instance *instance;
1224 instance = find_instance(curproc->p_sleeplocks, lock);
1225 if (instance == NULL) {
1231 if ((instance->li_flags & LI_EXCLUSIVE) == 0)
1234 if ((instance->li_flags & LI_RECURSEMASK) != 0)
1237 instance->li_flags & LI_RECURSEMASK);
1239 instance->li_flags &= ~LI_EXCLUSIVE;
1248 struct lock_instance *instance;
1258 /* Find lock instance associated with this lock. */
1274 instance = &(*lock_list)->ll_children[i];
1275 if (instance->li_lock == lock)
1293 if ((instance->li_flags & LI_EXCLUSIVE) != 0 && witness_watch > 0 &&
1300 if ((instance->li_flags & LI_EXCLUSIVE) == 0 && witness_watch > 0 &&
1307 if ((instance->li_flags & LI_RECURSEMASK) > 0) {
1308 instance->li_flags--;
1312 if ((instance->li_flags & LI_NORELEASE) != 0 && witness_watch > 0) {
1319 if (instance->li_stack != NULL) {
1320 witness_lock_stack_free(instance->li_stack);
1321 instance->li_stack = NULL;
1822 struct lock_instance *instance;
1827 instance = &lle->ll_children[i];
1828 if (instance->li_lock == lock)
1829 return (instance);
1836 witness_list_lock(struct lock_instance *instance,
1841 lock = instance->li_lock;
1842 prnt("%s %s %s", (instance->li_flags & LI_EXCLUSIVE) != 0 ?
1844 prnt(" r = %d (%p)\n", instance->li_flags & LI_RECURSEMASK, lock);
1845 if (instance->li_stack != NULL)
1846 stacktrace_print(&instance->li_stack->ls_stack, prnt);
1978 * per-cpu data to try to find the lock instance for this spin lock to
1985 struct lock_instance *instance;
1989 instance = find_instance(
1991 if (instance != NULL)
1992 witness_list_lock(instance, prnt);
1998 struct lock_instance *instance;
2006 instance = find_instance(curproc->p_sleeplocks, lock);
2008 instance = find_instance(
2017 if (instance != NULL)
2030 if (instance == NULL) {
2036 (instance->li_flags & LI_EXCLUSIVE) == 0)
2041 (instance->li_flags & LI_EXCLUSIVE) != 0)
2046 (instance->li_flags & LI_RECURSEMASK) == 0)
2050 (instance->li_flags & LI_RECURSEMASK) != 0)
2064 struct lock_instance *instance;
2075 instance = find_instance(lock_list, lock);
2076 if (instance == NULL) {
2083 instance->li_flags |= flag;
2085 instance->li_flags &= ~flag;