Lines Matching refs:prev
271 zfs_range_add_reader(avl_tree_t *tree, rl_t *new, rl_t *prev, avl_index_t where)
278 * prev arrives either:
284 if (prev) {
285 if (prev->r_off + prev->r_len <= off) {
286 prev = NULL;
287 } else if (prev->r_off != off) {
292 prev = zfs_range_split(tree, prev, off);
293 prev = AVL_NEXT(tree, prev); /* move to rear range */
296 ASSERT((prev == NULL) || (prev->r_off == off));
298 if (prev)
299 next = prev;
321 for (prev = NULL; next; prev = next, next = AVL_NEXT(tree, next)) {
324 if (prev && prev->r_off + prev->r_len < next->r_off) {
326 ASSERT3U(next->r_off, >, prev->r_off + prev->r_len);
327 zfs_range_new_proxy(tree, prev->r_off + prev->r_len,
328 next->r_off - (prev->r_off + prev->r_len));
348 zfs_range_new_proxy(tree, prev->r_off + prev->r_len,
349 (off + len) - (prev->r_off + prev->r_len));
359 rl_t *prev, *next;
368 prev = avl_find(tree, new, &where);
369 if (prev == NULL)
370 prev = (rl_t *)avl_nearest(tree, where, AVL_BEFORE);
375 if (prev && (off < prev->r_off + prev->r_len)) {
376 if ((prev->r_type == RL_WRITER) || (prev->r_write_wanted)) {
377 if (!prev->r_read_wanted) {
378 cv_init(&prev->r_rd_cv, NULL, CV_DEFAULT, NULL);
379 prev->r_read_wanted = B_TRUE;
381 cv_wait(&prev->r_rd_cv, &zp->z_range_lock);
384 if (off + len < prev->r_off + prev->r_len)
392 if (prev)
393 next = AVL_NEXT(tree, prev);
416 zfs_range_add_reader(tree, new, prev, where);