X-Git-Url: https://review.fuel-infra.org/gitweb?a=blobdiff_plain;f=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Ff2fs-tools%2F0001-configure-add-check-for-fallocate.patch;fp=cirros-testvm%2Fsrc-cirros%2Fbuildroot-2015.05%2Fpackage%2Ff2fs-tools%2F0001-configure-add-check-for-fallocate.patch;h=b7ead76cffcf29a9fd09961b5f9804a60b0910be;hb=b0a0f15dfaa205161a7fcb20cf1b8cd4948c2ef3;hp=0000000000000000000000000000000000000000;hpb=c6ac3cd55ee2da956195eee393b0882105dfad4e;p=packages%2Ftrusty%2Fcirros-testvm.git diff --git a/cirros-testvm/src-cirros/buildroot-2015.05/package/f2fs-tools/0001-configure-add-check-for-fallocate.patch b/cirros-testvm/src-cirros/buildroot-2015.05/package/f2fs-tools/0001-configure-add-check-for-fallocate.patch new file mode 100644 index 0000000..b7ead76 --- /dev/null +++ b/cirros-testvm/src-cirros/buildroot-2015.05/package/f2fs-tools/0001-configure-add-check-for-fallocate.patch @@ -0,0 +1,46 @@ +From 265d97d02e8ef373653c76a339869985eb3ba27a Mon Sep 17 00:00:00 2001 +From: Gustavo Zacarias +Date: Tue, 10 Mar 2015 15:10:35 -0300 +Subject: [PATCH] configure: add check for fallocate + +We need to check for fallocate() rather than just linux/falloc.h + +FALLOC_FL_PUNCH_HOLE since in uClibc we've got both but still not +fallocate() itself since it's only implemented in newer unreleased +versions. + +Status: sent upstream. + +Signed-off-by: Gustavo Zacarias +--- + configure.ac | 1 + + mkfs/f2fs_format_utils.c | 2 +- + 2 files changed, 2 insertions(+), 1 deletion(-) + +diff --git a/configure.ac b/configure.ac +index ae451b8..900b84a 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -68,6 +68,7 @@ AC_TYPE_SIZE_T + # Checks for library functions. + AC_FUNC_GETMNTENT + AC_CHECK_FUNCS_ONCE([ ++ fallocate + getmntent + memset + ]) +diff --git a/mkfs/f2fs_format_utils.c b/mkfs/f2fs_format_utils.c +index a0f85f5..ddeafeb 100644 +--- a/mkfs/f2fs_format_utils.c ++++ b/mkfs/f2fs_format_utils.c +@@ -46,7 +46,7 @@ int f2fs_trim_device() + #if defined(WITH_BLKDISCARD) && defined(BLKDISCARD) + MSG(0, "Info: Discarding device\n"); + if (S_ISREG(stat_buf.st_mode)) { +-#ifdef FALLOC_FL_PUNCH_HOLE ++#if defined(HAVE_FALLOCATE) && defined(FALLOC_FL_PUNCH_HOLE) + if (fallocate(config.fd, FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, + range[0], range[1]) < 0) { + MSG(0, "Info: fallocate(PUNCH_HOLE|KEEP_SIZE) is failed\n"); +-- +2.0.5 +