fadvise has been supported since Linux 2.5.60 and glibc 2.2. Signed-off-by: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Darrick J. Wong <djwong@xxxxxxxxxx> --- configure.ac | 1 - include/builddefs.in | 1 - io/Makefile | 9 +-------- io/io.h | 5 ----- m4/package_libcdev.m4 | 18 ------------------ 5 files changed, 1 insertion(+), 33 deletions(-) diff --git a/configure.ac b/configure.ac index 012508b8e..0b94dab18 100644 --- a/configure.ac +++ b/configure.ac @@ -162,7 +162,6 @@ AC_PACKAGE_NEED_PTHREADMUTEXINIT AC_PACKAGE_NEED_URCU_H AC_PACKAGE_NEED_RCU_INIT -AC_HAVE_FADVISE AC_HAVE_MADVISE AC_HAVE_MINCORE AC_HAVE_SENDFILE diff --git a/include/builddefs.in b/include/builddefs.in index a00283da1..42dc23174 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -90,7 +90,6 @@ ENABLE_SCRUB = @enable_scrub@ HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@ -HAVE_FADVISE = @have_fadvise@ HAVE_MADVISE = @have_madvise@ HAVE_MINCORE = @have_mincore@ HAVE_SENDFILE = @have_sendfile@ diff --git a/io/Makefile b/io/Makefile index 53fef09e8..a8ea64010 100644 --- a/io/Makefile +++ b/io/Makefile @@ -13,19 +13,12 @@ CFILES = init.c \ file.c freeze.c fsuuid.c fsync.c getrusage.c imap.c inject.c label.c \ link.c mmap.c open.c parent.c pread.c prealloc.c pwrite.c reflink.c \ resblks.c scrub.c seek.c shutdown.c stat.c swapext.c sync.c \ - truncate.c utimes.c + truncate.c utimes.c fadvise.c LLDLIBS = $(LIBXCMD) $(LIBHANDLE) $(LIBFROG) $(LIBPTHREAD) $(LIBUUID) LTDEPENDENCIES = $(LIBXCMD) $(LIBHANDLE) $(LIBFROG) LLDFLAGS = -static-libtool-libs -ifeq ($(HAVE_FADVISE),yes) -CFILES += fadvise.c -LCFLAGS += -DHAVE_FADVISE -else -LSRCFILES += fadvise.c -endif - ifeq ($(HAVE_MADVISE),yes) CFILES += madvise.c LCFLAGS += -DHAVE_MADVISE diff --git a/io/io.h b/io/io.h index fe474faf4..ad90cf3cb 100644 --- a/io/io.h +++ b/io/io.h @@ -116,12 +116,7 @@ extern void swapext_init(void); extern void sync_init(void); extern void truncate_init(void); extern void utimes_init(void); - -#ifdef HAVE_FADVISE extern void fadvise_init(void); -#else -#define fadvise_init() do { } while (0) -#endif #ifdef HAVE_SENDFILE extern void sendfile_init(void); diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 index 5d947a024..53d19a1b6 100644 --- a/m4/package_libcdev.m4 +++ b/m4/package_libcdev.m4 @@ -1,21 +1,3 @@ -# -# Check if we have a working fadvise system call -# -AC_DEFUN([AC_HAVE_FADVISE], - [ AC_MSG_CHECKING([for fadvise ]) - AC_COMPILE_IFELSE( - [ AC_LANG_PROGRAM([[ -#define _GNU_SOURCE -#include <fcntl.h> - ]], [[ -posix_fadvise(0, 1, 0, POSIX_FADV_NORMAL); - ]]) - ], have_fadvise=yes - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) - AC_SUBST(have_fadvise) - ]) - # # Check if we have a working madvise system call # -- 2.39.2