[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20181115155217.GA28043@jordon-HP-15-Notebook-PC>
Date: Thu, 15 Nov 2018 21:22:17 +0530
From: Souptick Joarder <jrdr.linux@...il.com>
To: akpm@...ux-foundation.org, willy@...radead.org, mhocko@...e.com,
boris.ostrovsky@...cle.com, jgross@...e.com
Cc: xen-devel@...ts.xenproject.org, linux-kernel@...r.kernel.org,
linux-mm@...ck.org
Subject: [PATCH 9/9] xen/privcmd-buf.c: Convert to use vm_insert_range
Convert to use vm_insert_range() to map range of kernel
memory to user vma.
Signed-off-by: Souptick Joarder <jrdr.linux@...il.com>
Reviewed-by: Matthew Wilcox <willy@...radead.org>
---
drivers/xen/privcmd-buf.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/xen/privcmd-buf.c b/drivers/xen/privcmd-buf.c
index df1ed37..8d8255b 100644
--- a/drivers/xen/privcmd-buf.c
+++ b/drivers/xen/privcmd-buf.c
@@ -180,12 +180,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_insert_range(vma, vma->vm_start, vma_priv->pages,
+ vma_priv->n_pages);
if (ret)
privcmd_buf_vmapriv_free(vma_priv);
--
1.9.1
Powered by blists - more mailing lists