}
spin_lock(&glob->lru_lock);
- ret = __ttm_bo_reserve(bo, false, true, NULL);
+ ret = reservation_object_trylock(bo->resv) ? 0 : -EBUSY;
if (!ret) {
if (reservation_object_test_signaled_rcu(&bo->ttm_resv, true)) {
ttm_bo_del_from_lru(bo);
return -EBUSY;
spin_lock(&glob->lru_lock);
- ret = __ttm_bo_reserve(bo, false, true, NULL);
+ ret = reservation_object_trylock(bo->resv) ? 0 : -EBUSY;
/*
* We raced, and lost, someone else holds the reservation now,
kref_get(&nentry->list_kref);
}
- ret = __ttm_bo_reserve(entry, false, true, NULL);
+ ret = reservation_object_trylock(entry->resv) ? 0 : -EBUSY;
if (remove_all && ret) {
spin_unlock(&glob->lru_lock);
- ret = __ttm_bo_reserve(entry, false, false, NULL);
+ ret = reservation_object_lock(entry->resv, NULL);
spin_lock(&glob->lru_lock);
}
spin_lock(&glob->lru_lock);
for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
list_for_each_entry(bo, &man->lru[i], lru) {
- ret = __ttm_bo_reserve(bo, false, true, NULL);
+ ret = reservation_object_trylock(bo->resv) ? 0 : -EBUSY;
if (ret)
continue;
spin_lock(&glob->lru_lock);
for (i = 0; i < TTM_MAX_BO_PRIORITY; ++i) {
list_for_each_entry(bo, &glob->swap_lru[i], swap) {
- ret = __ttm_bo_reserve(bo, false, true, NULL);
+ ret = reservation_object_trylock(bo->resv) ? 0 : -EBUSY;
if (!ret)
break;
}
return -ERESTARTSYS;
if (!ww_mutex_is_locked(&bo->resv->lock))
goto out_unlock;
- ret = __ttm_bo_reserve(bo, true, false, NULL);
+ ret = reservation_object_lock_interruptible(bo->resv, NULL);
+ if (ret == -EINTR)
+ ret = -ERESTARTSYS;
if (unlikely(ret != 0))
goto out_unlock;
reservation_object_unlock(bo->resv);
if (WARN_ON(ticket))
return -EBUSY;
- success = ww_mutex_trylock(&bo->resv->lock);
+ success = reservation_object_trylock(bo->resv);
return success ? 0 : -EBUSY;
}
if (interruptible)
- ret = ww_mutex_lock_interruptible(&bo->resv->lock, ticket);
+ ret = reservation_object_lock_interruptible(bo->resv, ticket);
else
- ret = ww_mutex_lock(&bo->resv->lock, ticket);
+ ret = reservation_object_lock(bo->resv, ticket);
if (ret == -EINTR)
return -ERESTARTSYS;
return ret;