fallocate has been supported since Linux 2.6.23 and glibc 2.10.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
AC_PACKAGE_NEED_URCU_H
AC_PACKAGE_NEED_RCU_INIT
-AC_HAVE_FALLOCATE
AC_HAVE_PWRITEV2
AC_HAVE_PREADV
AC_HAVE_COPY_FILE_RANGE
HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@
-HAVE_FALLOCATE = @have_fallocate@
HAVE_PREADV = @have_preadv@
HAVE_PWRITEV2 = @have_pwritev2@
HAVE_COPY_FILE_RANGE = @have_copy_file_range@
ifeq ($(HAVE_GETFSMAP),yes)
PCFLAGS+= -DHAVE_GETFSMAP
endif
-ifeq ($(HAVE_FALLOCATE),yes)
-PCFLAGS += -DHAVE_FALLOCATE
-endif
LIBICU_LIBS = @libicu_LIBS@
LIBICU_CFLAGS = @libicu_CFLAGS@
#include <asm/types.h>
#include <mntent.h>
#include <fcntl.h>
-#if defined(HAVE_FALLOCATE)
#include <linux/falloc.h>
-#endif
#ifdef OVERRIDE_SYSTEM_FSXATTR
# define fsxattr sys_fsxattr
#endif
LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP)
endif
-ifeq ($(HAVE_FALLOCATE),yes)
-LCFLAGS += -DHAVE_FALLOCATE
-endif
-
# Also implies PWRITEV
ifeq ($(HAVE_PREADV),yes)
LCFLAGS += -DHAVE_PREADV -DHAVE_PWRITEV
* All Rights Reserved.
*/
-#if defined(HAVE_FALLOCATE)
#include <linux/falloc.h>
-#endif
#include "command.h"
#include "input.h"
#include "init.h"
static cmdinfo_t resvsp_cmd;
static cmdinfo_t unresvsp_cmd;
static cmdinfo_t zero_cmd;
-#if defined(HAVE_FALLOCATE)
static cmdinfo_t falloc_cmd;
static cmdinfo_t fpunch_cmd;
static cmdinfo_t fcollapse_cmd;
static cmdinfo_t finsert_cmd;
static cmdinfo_t fzero_cmd;
static cmdinfo_t funshare_cmd;
-#endif
static int
offset_length(
}
-#if defined (HAVE_FALLOCATE)
static void
falloc_help(void)
{
}
return 0;
}
-#endif /* HAVE_FALLOCATE */
void
prealloc_init(void)
add_command(&unresvsp_cmd);
add_command(&zero_cmd);
-#if defined (HAVE_FALLOCATE)
falloc_cmd.name = "falloc";
falloc_cmd.cfunc = fallocate_f;
falloc_cmd.argmin = 2;
funshare_cmd.oneline =
_("unshares shared blocks within the range");
add_command(&funshare_cmd);
-#endif /* HAVE_FALLOCATE */
}
-#
-# Check if we have a fallocate libc call (Linux)
-#
-AC_DEFUN([AC_HAVE_FALLOCATE],
- [ AC_MSG_CHECKING([for fallocate])
- AC_LINK_IFELSE(
- [ AC_LANG_PROGRAM([[
-#define _GNU_SOURCE
-#include <fcntl.h>
-#include <linux/falloc.h>
- ]], [[
-fallocate(0, 0, 0, 0);
- ]])
- ], have_fallocate=yes
- AC_MSG_RESULT(yes),
- AC_MSG_RESULT(no))
- AC_SUBST(have_fallocate)
- ])
-
#
# Check if we have a preadv libc call (Linux)
#