Lines Matching refs:ref

295 	struct ttm_ref_object *ref;  in ttm_ref_object_add()  local
310 ref = hlist_entry(hash, struct ttm_ref_object, hash); in ttm_ref_object_add()
311 if (kref_get_unless_zero(&ref->kref)) { in ttm_ref_object_add()
321 ref = kmalloc(sizeof(*ref), GFP_KERNEL); in ttm_ref_object_add()
322 if (unlikely(ref == NULL)) { in ttm_ref_object_add()
326 ref->hash.key = base->handle; in ttm_ref_object_add()
327 ref->obj = base; in ttm_ref_object_add()
328 ref->tfile = tfile; in ttm_ref_object_add()
329 kref_init(&ref->kref); in ttm_ref_object_add()
332 hash_add_rcu(tfile->ref_hash, &ref->hash.head, ref->hash.key); in ttm_ref_object_add()
335 list_add_tail(&ref->head, &tfile->ref_list); in ttm_ref_object_add()
348 struct ttm_ref_object *ref = in ttm_ref_object_release() local
350 struct ttm_object_file *tfile = ref->tfile; in ttm_ref_object_release()
352 hash_del_rcu(&ref->hash.head); in ttm_ref_object_release()
353 list_del(&ref->head); in ttm_ref_object_release()
356 ttm_base_object_unref(&ref->obj); in ttm_ref_object_release()
357 kfree_rcu(ref, rcu_head); in ttm_ref_object_release()
364 struct ttm_ref_object *ref; in ttm_ref_object_base_unref() local
374 ref = hlist_entry(hash, struct ttm_ref_object, hash); in ttm_ref_object_base_unref()
375 kref_put(&ref->kref, ttm_ref_object_release); in ttm_ref_object_base_unref()
382 struct ttm_ref_object *ref; in ttm_object_file_release() local
396 ref = list_entry(list, struct ttm_ref_object, head); in ttm_object_file_release()
397 ttm_ref_object_release(&ref->kref); in ttm_object_file_release()