[CRIU] [PATCH 07/10] deduplication: add punching holes in "parent"
Andrew Vagin
avagin at parallels.com
Tue Nov 19 03:46:48 PST 2013
On Tue, Nov 19, 2013 at 02:28:26PM +0400, Tikhomirov Pavel wrote:
> punch where coresponding data was updated in curent snapshot
>
> Signed-off-by: Tikhomirov Pavel <snorcht at gmail.com>
> ---
> cr-dedup.c | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/cr-dedup.c b/cr-dedup.c
> index a8df351..6bc43f0 100644
> --- a/cr-dedup.c
> +++ b/cr-dedup.c
> @@ -1,3 +1,4 @@
> +#include <linux/falloc.h>
> #include <unistd.h>
>
> #include "crtools.h"
> @@ -101,6 +102,17 @@ int cr_dedup_one_pagemap(int pid)
> off_real = lseek(prp->fd_pg, 0, SEEK_CUR);
>
> /*Here to punch that pagemap*/
> + if (!pr.pe->in_parent && !prp->pe->in_parent) {
> + /* punch */
redundant comment
> + pr_info("Punch!/%lu/%lu/\n", off_real, min(piov_end, iov_end) - off);
pr_debug
> +
> + ret = fallocate(prp->fd_pg, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> + off_real, min(piov_end, iov_end) - off);
> + if (ret != 0) {
> + pr_err("Error punching hole : %d\n", errno);
pr_perror
> + goto exit;
> + }
> + }
>
> if (piov_end < iov_end) {
> off = piov_end;
> --
> 1.7.9.5
>
> _______________________________________________
> CRIU mailing list
> CRIU at openvz.org
> https://lists.openvz.org/mailman/listinfo/criu
More information about the CRIU
mailing list