Lines Matching refs:next
291 locked_range_t *next; in rangelock_add_reader() local
317 next = prev; in rangelock_add_reader()
319 next = avl_nearest(tree, where, AVL_AFTER); in rangelock_add_reader()
321 if (next == NULL || off + len <= next->lr_offset) { in rangelock_add_reader()
327 if (off < next->lr_offset) { in rangelock_add_reader()
329 rangelock_new_proxy(tree, off, next->lr_offset - off); in rangelock_add_reader()
339 for (prev = NULL; next; prev = next, next = AVL_NEXT(tree, next)) { in rangelock_add_reader()
340 if (off + len <= next->lr_offset) in rangelock_add_reader()
343 next->lr_offset) { in rangelock_add_reader()
345 ASSERT3U(next->lr_offset, >, in rangelock_add_reader()
349 next->lr_offset - in rangelock_add_reader()
352 if (off + len == next->lr_offset + next->lr_length) { in rangelock_add_reader()
354 next = rangelock_proxify(tree, next); in rangelock_add_reader()
355 next->lr_count++; in rangelock_add_reader()
358 if (off + len < next->lr_offset + next->lr_length) { in rangelock_add_reader()
360 next = rangelock_split(tree, next, off + len); in rangelock_add_reader()
361 next->lr_count++; in rangelock_add_reader()
364 ASSERT3U(off + len, >, next->lr_offset + next->lr_length); in rangelock_add_reader()
365 next = rangelock_proxify(tree, next); in rangelock_add_reader()
366 next->lr_count++; in rangelock_add_reader()
381 locked_range_t *prev, *next; in rangelock_enter_reader() local
416 next = AVL_NEXT(tree, prev); in rangelock_enter_reader()
418 next = (locked_range_t *)avl_nearest(tree, where, AVL_AFTER); in rangelock_enter_reader()
419 for (; next != NULL; next = AVL_NEXT(tree, next)) { in rangelock_enter_reader()
420 if (off + len <= next->lr_offset) in rangelock_enter_reader()
422 if ((next->lr_type == RL_WRITER) || (next->lr_write_wanted)) { in rangelock_enter_reader()
423 if (!next->lr_read_wanted) { in rangelock_enter_reader()
424 cv_init(&next->lr_read_cv, in rangelock_enter_reader()
426 next->lr_read_wanted = B_TRUE; in rangelock_enter_reader()
428 cv_wait(&next->lr_read_cv, &rl->rl_lock); in rangelock_enter_reader()
431 if (off + len <= next->lr_offset + next->lr_length) in rangelock_enter_reader()
522 locked_range_t *next = NULL; in rangelock_exit_reader() local
523 for (len = remove->lr_length; len != 0; lr = next) { in rangelock_exit_reader()
526 next = AVL_NEXT(tree, lr); in rangelock_exit_reader()
527 ASSERT3P(next, !=, NULL); in rangelock_exit_reader()
529 next->lr_offset); in rangelock_exit_reader()
530 ASSERT3U(next->lr_count, !=, 0); in rangelock_exit_reader()
531 ASSERT3U(next->lr_type, ==, RL_READER); in rangelock_exit_reader()