[CRIU] [PATCH] pagemap: include falloc.h for FALLOC_FL_PUNCH_HOLE
Adrian Reber
adrian at lisas.de
Mon Jun 27 04:30:23 PDT 2016
On Fri, Jun 24, 2016 at 04:53:50PM +0300, Dmitry Safonov wrote:
> Otherwise on some older environments like RHEL7 it will fail to build with:
> CC pagemap.o
> pagemap.c: In function ‘punch_hole’:
> pagemap.c:54:40: error: ‘FALLOC_FL_PUNCH_HOLE’ undeclared (first use in this function)
> ret = fallocate(img_raw_fd(pr->pi), FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> pagemap.c:54:40: note: each undeclared identifier is reported only once for each function it appears in
> pagemap.c:54:63: error: ‘FALLOC_FL_KEEP_SIZE’ undeclared (first use in this function)
> ret = fallocate(img_raw_fd(pr->pi), FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
> make[2]: *** [pagemap.o] Error 1
>
> CC: Mike Rapoport <rppt at linux.vnet.ibm.com>
> Signed-off-by: Dmitry Safonov <dsafonov at virtuozzo.com>
> ---
> criu/pagemap.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/criu/pagemap.c b/criu/pagemap.c
> index 93eb999025ef..84f32b996d59 100644
> --- a/criu/pagemap.c
> +++ b/criu/pagemap.c
> @@ -1,6 +1,7 @@
> #include <fcntl.h>
> #include <stdio.h>
> #include <unistd.h>
> +#include <linux/falloc.h>
>
> #include "image.h"
> #include "cr_options.h"
> --
> 2.9.0
Acked-by: Adrian Reber <areber at redhat.com>
Adrian
More information about the CRIU
mailing list