RDMA: use DMA_RESV_USAGE_KERNEL
[linux-2.6-microblaze.git] / drivers / infiniband / core / umem_dmabuf.c
index f076074..fce80a4 100644 (file)
@@ -16,7 +16,6 @@ int ib_umem_dmabuf_map_pages(struct ib_umem_dmabuf *umem_dmabuf)
 {
        struct sg_table *sgt;
        struct scatterlist *sg;
-       struct dma_fence *fence;
        unsigned long start, end, cur = 0;
        unsigned int nmap = 0;
        int i;
@@ -68,11 +67,9 @@ wait_fence:
         * may be not up-to-date. Wait for the exporter to finish
         * the migration.
         */
-       fence = dma_resv_excl_fence(umem_dmabuf->attach->dmabuf->resv);
-       if (fence)
-               return dma_fence_wait(fence, false);
-
-       return 0;
+       return dma_resv_wait_timeout(umem_dmabuf->attach->dmabuf->resv,
+                                    DMA_RESV_USAGE_KERNEL,
+                                    false, MAX_SCHEDULE_TIMEOUT);
 }
 EXPORT_SYMBOL(ib_umem_dmabuf_map_pages);