#include <linux/dma-buf.h>
 #include <linux/dma-heap.h>
 #include <linux/dma-map-ops.h>
+#include <linux/dma-resv.h>
 #include <linux/err.h>
 #include <linux/highmem.h>
 #include <linux/io.h>
 {
        struct cma_heap_buffer *buffer = dmabuf->priv;
 
+       dma_resv_assert_held(dmabuf->resv);
+
        if ((vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) == 0)
                return -EINVAL;
 
 
 #include <linux/dma-buf.h>
 #include <linux/dma-mapping.h>
 #include <linux/dma-heap.h>
+#include <linux/dma-resv.h>
 #include <linux/err.h>
 #include <linux/highmem.h>
 #include <linux/mm.h>
        struct sg_page_iter piter;
        int ret;
 
+       dma_resv_assert_held(dmabuf->resv);
+
        for_each_sgtable_page(table, &piter, vma->vm_pgoff) {
                struct page *page = sg_page_iter_page(&piter);