dma-buf: Move dma_buf_vmap() to dynamic locking specification
[linux-2.6-microblaze.git] / drivers / dma-buf / dma-buf.c
index 3e4060d..2c4381b 100644 (file)
@@ -1450,6 +1450,8 @@ int dma_buf_vmap(struct dma_buf *dmabuf, struct iosys_map *map)
        if (WARN_ON(!dmabuf))
                return -EINVAL;
 
+       dma_resv_assert_held(dmabuf->resv);
+
        if (!dmabuf->ops->vmap)
                return -EINVAL;
 
@@ -1515,6 +1517,8 @@ void dma_buf_vunmap(struct dma_buf *dmabuf, struct iosys_map *map)
        if (WARN_ON(!dmabuf))
                return;
 
+       dma_resv_assert_held(dmabuf->resv);
+
        BUG_ON(iosys_map_is_null(&dmabuf->vmap_ptr));
        BUG_ON(dmabuf->vmapping_counter == 0);
        BUG_ON(!iosys_map_is_equal(&dmabuf->vmap_ptr, map));