pagemap: include falloc.h for FALLOC_FL_PUNCH_HOLE

Submitted by Dmitry Safonov on June 24, 2016, 1:53 p.m.

Details

Message ID 20160624135350.12460-1-dsafonov@virtuozzo.com
State Accepted
Series "pagemap: include falloc.h for FALLOC_FL_PUNCH_HOLE"
Commit f50d86ae2dfcbf4a04259ef90c4c250ce15da3e2
Headers show

Commit Message

Dmitry Safonov June 24, 2016, 1:53 p.m.
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@linux.vnet.ibm.com>
Signed-off-by: Dmitry Safonov <dsafonov@virtuozzo.com>
---
 criu/pagemap.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

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"

Comments

Adrian Reber June 27, 2016, 11:30 a.m.
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@linux.vnet.ibm.com>
> Signed-off-by: Dmitry Safonov <dsafonov@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@redhat.com>

		Adrian
Pavel Emelianov June 27, 2016, 3:02 p.m.
applied