Lines Matching refs:ref

100 	reference_t *ref;  in zfs_refcount_destroy_many()  local
104 while ((ref = avl_destroy_nodes(&rc->rc_tree, &cookie)) != NULL) in zfs_refcount_destroy_many()
105 kmem_cache_free(reference_cache, ref); in zfs_refcount_destroy_many()
108 while ((ref = list_remove_head(&rc->rc_removed))) { in zfs_refcount_destroy_many()
109 kmem_cache_free(reference_history_cache, ref->ref_removed); in zfs_refcount_destroy_many()
110 kmem_cache_free(reference_cache, ref); in zfs_refcount_destroy_many()
137 reference_t *ref; in zfs_refcount_add_many() local
146 ref = kmem_cache_alloc(reference_cache, KM_SLEEP); in zfs_refcount_add_many()
147 ref->ref_holder = holder; in zfs_refcount_add_many()
148 ref->ref_number = number; in zfs_refcount_add_many()
149 ref->ref_search = B_FALSE; in zfs_refcount_add_many()
151 avl_add(&rc->rc_tree, ref); in zfs_refcount_add_many()
180 reference_t *ref, s; in zfs_refcount_remove_many() local
194 ref = avl_find(&rc->rc_tree, &s, NULL); in zfs_refcount_remove_many()
195 if (unlikely(ref == NULL)) { in zfs_refcount_remove_many()
199 avl_remove(&rc->rc_tree, ref); in zfs_refcount_remove_many()
201 ref->ref_removed = kmem_cache_alloc(reference_history_cache, in zfs_refcount_remove_many()
203 list_insert_head(&rc->rc_removed, ref); in zfs_refcount_remove_many()
205 ref = list_remove_tail(&rc->rc_removed); in zfs_refcount_remove_many()
207 ref->ref_removed); in zfs_refcount_remove_many()
208 kmem_cache_free(reference_cache, ref); in zfs_refcount_remove_many()
213 kmem_cache_free(reference_cache, ref); in zfs_refcount_remove_many()
243 reference_t *ref; in zfs_refcount_transfer() local
267 else while ((ref = avl_destroy_nodes(&tree, &cookie)) != NULL) in zfs_refcount_transfer()
268 avl_add(&dst->rc_tree, ref); in zfs_refcount_transfer()
280 reference_t *ref, s; in zfs_refcount_transfer_ownership_many() local
289 ref = avl_find(&rc->rc_tree, &s, NULL); in zfs_refcount_transfer_ownership_many()
290 ASSERT3P(ref, !=, NULL); in zfs_refcount_transfer_ownership_many()
291 ref->ref_holder = new_holder; in zfs_refcount_transfer_ownership_many()
292 avl_update(&rc->rc_tree, ref); in zfs_refcount_transfer_ownership_many()
312 reference_t *ref, s; in zfs_refcount_held() local
323 ref = avl_find(&rc->rc_tree, &s, &idx); in zfs_refcount_held()
324 if (likely(ref == NULL)) in zfs_refcount_held()
325 ref = avl_nearest(&rc->rc_tree, idx, AVL_AFTER); in zfs_refcount_held()
326 res = ref && ref->ref_holder == holder; in zfs_refcount_held()
339 reference_t *ref, s; in zfs_refcount_not_held() local
350 ref = avl_find(&rc->rc_tree, &s, &idx); in zfs_refcount_not_held()
351 if (likely(ref == NULL)) in zfs_refcount_not_held()
352 ref = avl_nearest(&rc->rc_tree, idx, AVL_AFTER); in zfs_refcount_not_held()
353 res = ref == NULL || ref->ref_holder != holder; in zfs_refcount_not_held()