static void ttm_release_base(struct kref *kref) { struct ttm_base_object *base = container_of(kref, struct ttm_base_object, refcount); struct ttm_object_device *tdev = base->tfile->tdev; (void)drm_ht_remove_item(&tdev->object_hash, &base->hash); write_unlock(&tdev->object_lock); if (base->refcount_release) { ttm_object_file_unref(&base->tfile); base->refcount_release(&base); } write_lock(&tdev->object_lock); }
static void ttm_release_base(struct ttm_base_object *base) { struct ttm_object_device *tdev = base->tfile->tdev; (void)drm_ht_remove_item(&tdev->object_hash, &base->hash); rw_wunlock(&tdev->object_lock); /* * Note: We don't use synchronize_rcu() here because it's far * too slow. It's up to the user to free the object using * call_rcu() or ttm_base_object_kfree(). */ if (base->refcount_release) { ttm_object_file_unref(&base->tfile); base->refcount_release(&base); } rw_wlock(&tdev->object_lock); }
static void ttm_release_base(struct kref *kref) { struct ttm_base_object *base = container_of(kref, struct ttm_base_object, refcount); struct ttm_object_device *tdev = base->tfile->tdev; spin_lock(&tdev->object_lock); (void)drm_ht_remove_item_rcu(&tdev->object_hash, &base->hash); spin_unlock(&tdev->object_lock); /* * Note: We don't use synchronize_rcu() here because it's far * too slow. It's up to the user to free the object using * call_rcu() or ttm_base_object_kfree(). */ ttm_object_file_unref(&base->tfile); if (base->refcount_release) base->refcount_release(&base); }
static void ttm_release_base(struct kref *kref) { struct ttm_base_object *base = container_of(kref, struct ttm_base_object, refcount); struct ttm_object_device *tdev = base->tfile->tdev; if (atomic_read(&kref->refcount)) { lockmgr(&tdev->object_lock, LK_RELEASE); return; } (void)drm_ht_remove_item(&tdev->object_hash, &base->hash); lockmgr(&tdev->object_lock, LK_RELEASE); /* * Note: We don't use synchronize_rcu() here because it's far * too slow. It's up to the user to free the object using * call_rcu() or ttm_base_object_kfree(). */ if (base->refcount_release) { ttm_object_file_unref(&base->tfile); base->refcount_release(&base); } }