mirror of
https://github.com/checkpoint-restore/criu
synced 2025-08-31 14:25:49 +00:00
uffdd: Read pages directly into destination buffer
This avoids excessive memcpy() one instruction below. travis-ci: success for uffd: A set of improvements over criu/uffd.c Signed-off-by: Pavel Emelyanov <xemul@virtuozzo.com> Acked-by: Mike Rapoport <rppt@linux.vnet.ibm.com>
This commit is contained in:
committed by
Andrei Vagin
parent
82c8229100
commit
345b4e77ef
@@ -380,7 +380,6 @@ out:
|
||||
static int get_page(struct lazy_pages_info *lpi, unsigned long addr, void *dest)
|
||||
{
|
||||
int ret;
|
||||
unsigned char buf[PAGE_SIZE];
|
||||
|
||||
lpi->pr.reset(&lpi->pr);
|
||||
|
||||
@@ -392,13 +391,11 @@ static int get_page(struct lazy_pages_info *lpi, unsigned long addr, void *dest)
|
||||
if (pagemap_zero(lpi->pr.pe))
|
||||
return 0;
|
||||
|
||||
ret = lpi->pr.read_pages(&lpi->pr, addr, 1, buf, 0);
|
||||
ret = lpi->pr.read_pages(&lpi->pr, addr, 1, dest, 0);
|
||||
pr_debug("read_pages ret %d\n", ret);
|
||||
if (ret <= 0)
|
||||
return ret;
|
||||
|
||||
memcpy(dest, buf, PAGE_SIZE);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user