52 #define pr_fmt(fmt) "[TTM] " fmt
56 #include <linux/list.h>
58 #include <linux/slab.h>
59 #include <linux/module.h>
126 static void ttm_object_file_destroy(
struct kref *
kref)
135 static inline void ttm_object_file_unref(
struct ttm_object_file **p_tfile)
140 kref_put(&tfile->
refcount, ttm_object_file_destroy);
156 base->
tfile = ttm_object_file_ref(tfile);
164 (
unsigned long)base, 31, 0, 0);
183 static void ttm_release_base(
struct kref *
kref)
192 ttm_object_file_unref(&base->
tfile);
211 kref_put(&base->
refcount, ttm_release_base);
237 pr_err(
"Attempted access of non-shareable object\n");
265 kref_get(&ref->
kref);
285 kref_init(&ref->
kref);
310 static void ttm_ref_object_release(
struct kref *kref)
348 kref_put(&ref->
kref, ttm_ref_object_release);
369 while (!list_empty(&tfile->
ref_list)) {
372 ttm_ref_object_release(&ref->
kref);
379 ttm_object_file_unref(&tfile);
384 unsigned int hash_order)
409 for (i = 0; i <
j; ++
i)
420 unsigned int hash_order)