Commit e3f05ea0 authored by Mike Rapoport's avatar Mike Rapoport Committed by Andrei Vagin

uffd: increment uffd_copied_pages only in one place

The uffd_copied_pages can be incremented in uffd_copy_page function rather
than in its callers
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 a7004002
...@@ -279,6 +279,7 @@ static int uffd_copy_page(int uffd, __u64 address, void *dest) ...@@ -279,6 +279,7 @@ static int uffd_copy_page(int uffd, __u64 address, void *dest)
return -1; return -1;
} }
uffd_copied_pages++;
return uffdio_copy.copy; return uffdio_copy.copy;
...@@ -359,7 +360,6 @@ static int handle_remaining_pages(int uffd, struct list_head *uffd_list, void *d ...@@ -359,7 +360,6 @@ static int handle_remaining_pages(int uffd, struct list_head *uffd_list, void *d
return -1; return -1;
} }
uffd_copied_pages++;
uffd_pages->flags |= UFFD_FLAG_SENT; uffd_pages->flags |= UFFD_FLAG_SENT;
} }
...@@ -378,7 +378,6 @@ static int handle_regular_pages(int uffd, struct list_head *uffd_list, void *des ...@@ -378,7 +378,6 @@ static int handle_regular_pages(int uffd, struct list_head *uffd_list, void *des
return -1; return -1;
} }
uffd_copied_pages++;
/* /*
* Mark this page as having been already transferred, so * Mark this page as having been already transferred, so
* that it has not to be copied again later. * that it has not to be copied again later.
......
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