Lines Matching refs:ref

96 	reference_t *ref;  in zfs_refcount_destroy_many()  local
100 while ((ref = avl_destroy_nodes(&rc->rc_tree, &cookie)) != NULL) in zfs_refcount_destroy_many()
101 kmem_cache_free(reference_cache, ref); in zfs_refcount_destroy_many()
104 while ((ref = list_remove_head(&rc->rc_removed))) in zfs_refcount_destroy_many()
105 kmem_cache_free(reference_cache, ref); in zfs_refcount_destroy_many()
131 reference_t *ref; in zfs_refcount_add_many() local
140 ref = kmem_cache_alloc(reference_cache, KM_SLEEP); in zfs_refcount_add_many()
141 ref->ref_holder = holder; in zfs_refcount_add_many()
142 ref->ref_number = number; in zfs_refcount_add_many()
143 ref->ref_search = B_FALSE; in zfs_refcount_add_many()
145 avl_add(&rc->rc_tree, ref); in zfs_refcount_add_many()
172 reference_t *ref, s; in zfs_refcount_remove_many() local
186 ref = avl_find(&rc->rc_tree, &s, NULL); in zfs_refcount_remove_many()
187 if (unlikely(ref == NULL)) { in zfs_refcount_remove_many()
193 avl_remove(&rc->rc_tree, ref); in zfs_refcount_remove_many()
195 list_insert_head(&rc->rc_removed, ref); in zfs_refcount_remove_many()
197 ref = list_remove_tail(&rc->rc_removed); in zfs_refcount_remove_many()
198 kmem_cache_free(reference_cache, ref); in zfs_refcount_remove_many()
203 kmem_cache_free(reference_cache, ref); in zfs_refcount_remove_many()
231 reference_t *ref; in zfs_refcount_transfer() local
255 else while ((ref = avl_destroy_nodes(&tree, &cookie)) != NULL) in zfs_refcount_transfer()
256 avl_add(&dst->rc_tree, ref); in zfs_refcount_transfer()
268 reference_t *ref, s; in zfs_refcount_transfer_ownership_many() local
277 ref = avl_find(&rc->rc_tree, &s, NULL); in zfs_refcount_transfer_ownership_many()
278 ASSERT(ref); in zfs_refcount_transfer_ownership_many()
279 ref->ref_holder = new_holder; in zfs_refcount_transfer_ownership_many()
280 avl_update(&rc->rc_tree, ref); in zfs_refcount_transfer_ownership_many()
300 reference_t *ref, s; in zfs_refcount_held() local
311 ref = avl_find(&rc->rc_tree, &s, &idx); in zfs_refcount_held()
312 if (likely(ref == NULL)) in zfs_refcount_held()
313 ref = avl_nearest(&rc->rc_tree, idx, AVL_AFTER); in zfs_refcount_held()
314 res = ref && ref->ref_holder == holder; in zfs_refcount_held()
327 reference_t *ref, s; in zfs_refcount_not_held() local
338 ref = avl_find(&rc->rc_tree, &s, &idx); in zfs_refcount_not_held()
339 if (likely(ref == NULL)) in zfs_refcount_not_held()
340 ref = avl_nearest(&rc->rc_tree, idx, AVL_AFTER); in zfs_refcount_not_held()
341 res = ref == NULL || ref->ref_holder != holder; in zfs_refcount_not_held()