Lines Matching defs:ref
72 * @ref_hash: Hash tables of ref objects, one per ttm_ref_type,
73 * for fast lookup of ref objects given a base object.
108 * @head: List entry for the per-file list of ref-objects.
112 * @obj: Base object this ref object is referencing.
114 * @ref_type: Type of ref object.
119 * a particular ttm_object_file. It also carries a ref count to avoid creating
120 * multiple ref objects if a ttm_object_file references the same base
298 struct ttm_ref_object *ref;
313 ref = hlist_entry(hash, struct ttm_ref_object, hash);
314 if (kref_get_unless_zero(&ref->kref)) {
324 ref = kmalloc(sizeof(*ref), GFP_KERNEL);
325 if (unlikely(ref == NULL)) {
329 ref->hash.key = base->handle;
330 ref->obj = base;
331 ref->tfile = tfile;
332 kref_init(&ref->kref);
335 hash_add_rcu(tfile->ref_hash, &ref->hash.head, ref->hash.key);
338 list_add_tail(&ref->head, &tfile->ref_list);
351 struct ttm_ref_object *ref =
353 struct ttm_object_file *tfile = ref->tfile;
355 hash_del_rcu(&ref->hash.head);
356 list_del(&ref->head);
359 ttm_base_object_unref(&ref->obj);
360 kfree_rcu(ref, rcu_head);
367 struct ttm_ref_object *ref;
377 ref = hlist_entry(hash, struct ttm_ref_object, hash);
378 kref_put(&ref->kref, ttm_ref_object_release);
385 struct ttm_ref_object *ref;
399 ref = list_entry(list, struct ttm_ref_object, head);
400 ttm_ref_object_release(&ref->kref);