libnvdimm, MAINTAINERS: Maintainer Entry Profile
[linux-2.6-microblaze.git] / drivers / xen / privcmd-buf.c
index a1c61e3..dd5bbb6 100644 (file)
@@ -165,12 +165,8 @@ static int privcmd_buf_mmap(struct file *file, struct vm_area_struct *vma)
        if (vma_priv->n_pages != count)
                ret = -ENOMEM;
        else
-               for (i = 0; i < vma_priv->n_pages; i++) {
-                       ret = vm_insert_page(vma, vma->vm_start + i * PAGE_SIZE,
-                                            vma_priv->pages[i]);
-                       if (ret)
-                               break;
-               }
+               ret = vm_map_pages_zero(vma, vma_priv->pages,
+                                               vma_priv->n_pages);
 
        if (ret)
                privcmd_buf_vmapriv_free(vma_priv);