Commit 58edba63 authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

uffd: introduce uffd_handle_page

so that it'll be able to handle both UFFDIO_COPY and UFFDIO_ZEROPAGE
Signed-off-by: 's avatarMike Rapoport <rppt@linux.vnet.ibm.com>
Acked-by: 's avatarAdrian Reber <areber@redhat.com>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent e3f05ea0
...@@ -285,6 +285,11 @@ static int uffd_copy_page(int uffd, __u64 address, void *dest) ...@@ -285,6 +285,11 @@ static int uffd_copy_page(int uffd, __u64 address, void *dest)
} }
static int uffd_handle_page(int uffd, __u64 address, void *dest)
{
return uffd_copy_page(uffd, address, dest);
}
static int collect_uffd_pages(struct page_read *pr, struct list_head *uffd_list) static int collect_uffd_pages(struct page_read *pr, struct list_head *uffd_list)
{ {
unsigned long base; unsigned long base;
...@@ -354,7 +359,7 @@ static int handle_remaining_pages(int uffd, struct list_head *uffd_list, void *d ...@@ -354,7 +359,7 @@ static int handle_remaining_pages(int uffd, struct list_head *uffd_list, void *d
if (uffd_pages->flags & UFFD_FLAG_SENT) if (uffd_pages->flags & UFFD_FLAG_SENT)
continue; continue;
rc = uffd_copy_page(uffd, uffd_pages->addr, dest); rc = uffd_handle_page(uffd, uffd_pages->addr, dest);
if (rc < 0) { if (rc < 0) {
pr_err("Error during UFFD copy\n"); pr_err("Error during UFFD copy\n");
return -1; return -1;
...@@ -372,7 +377,7 @@ static int handle_regular_pages(int uffd, struct list_head *uffd_list, void *des ...@@ -372,7 +377,7 @@ static int handle_regular_pages(int uffd, struct list_head *uffd_list, void *des
int rc; int rc;
struct uffd_pages_struct *uffd_pages; struct uffd_pages_struct *uffd_pages;
rc = uffd_copy_page(uffd, address, dest); rc = uffd_handle_page(uffd, address, dest);
if (rc < 0) { if (rc < 0) {
pr_err("Error during UFFD copy\n"); pr_err("Error during UFFD copy\n");
return -1; return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment