Lines Matching refs:rs

56 	range_seg_t *rs;
60 for (rs = avl_first(&rt->rt_root); rs != NULL;
61 rs = AVL_NEXT(&rt->rt_root, rs)) {
62 uint64_t size = rs->rs_end - rs->rs_start;
79 range_tree_stat_incr(range_tree_t *rt, range_seg_t *rs)
81 uint64_t size = rs->rs_end - rs->rs_start;
94 range_tree_stat_decr(range_tree_t *rt, range_seg_t *rs)
96 uint64_t size = rs->rs_end - rs->rs_start;
167 range_seg_t rsearch, *rs_before, *rs_after, *rs;
176 rs = avl_find(&rt->rt_root, &rsearch, &where);
178 if (rs != NULL && rs->rs_start <= start && rs->rs_end >= end) {
186 VERIFY(rs == NULL);
206 rs = rs_after;
214 rs = rs_before;
222 rs = rs_after;
224 rs = kmem_cache_alloc(range_seg_cache, KM_SLEEP);
225 rs->rs_start = start;
226 rs->rs_end = end;
227 avl_insert(&rt->rt_root, rs, where);
231 rt->rt_ops->rtop_add(rt, rs, rt->rt_arg);
233 range_tree_stat_incr(rt, rs);
242 range_seg_t rsearch, *rs, *newseg;
252 rs = avl_find(&rt->rt_root, &rsearch, &where);
255 if (rs == NULL) {
261 VERIFY3U(rs->rs_start, <=, start);
262 VERIFY3U(rs->rs_end, >=, end);
264 left_over = (rs->rs_start != start);
265 right_over = (rs->rs_end != end);
267 range_tree_stat_decr(rt, rs);
270 rt->rt_ops->rtop_remove(rt, rs, rt->rt_arg);
275 newseg->rs_end = rs->rs_end;
278 rs->rs_end = start;
280 avl_insert_here(&rt->rt_root, newseg, rs, AVL_AFTER);
284 rs->rs_end = start;
286 rs->rs_start = end;
288 avl_remove(&rt->rt_root, rs);
289 kmem_cache_free(range_seg_cache, rs);
290 rs = NULL;
293 if (rs != NULL) {
294 range_tree_stat_incr(rt, rs);
297 rt->rt_ops->rtop_add(rt, rs, rt->rt_arg);
321 range_seg_t *rs = range_tree_find_impl(rt, start, size);
322 if (rs != NULL && rs->rs_start <= start && rs->rs_end >= start + size)
323 return (rs);
330 range_seg_t *rs;
333 rs = range_tree_find(rt, off, size);
334 if (rs != NULL)
335 panic("freeing free block; rs=%p", (void *)rs);
352 range_seg_t *rs;
354 while ((rs = range_tree_find_impl(rt, start, size)) != NULL) {
355 uint64_t free_start = MAX(rs->rs_start, start);
356 uint64_t free_end = MIN(rs->rs_end, start + size);
378 range_seg_t *rs;
386 while ((rs = avl_destroy_nodes(&rt->rt_root, &cookie)) != NULL) {
388 func(arg, rs->rs_start, rs->rs_end - rs->rs_start);
389 kmem_cache_free(range_seg_cache, rs);
399 range_seg_t *rs;
403 for (rs = avl_first(&rt->rt_root); rs; rs = AVL_NEXT(&rt->rt_root, rs))
404 func(arg, rs->rs_start, rs->rs_end - rs->rs_start);