From 636f77efe54e33723740828815538b4f8b8cadde Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Thu, 15 Feb 2024 07:54:17 +0100 Subject: [PATCH] configure: don't check for preadv and pwritev preadv and pwritev have been supported since Linux 2.6.30. Signed-off-by: Christoph Hellwig Reviewed-by: "Darrick J. Wong" Signed-off-by: Carlos Maiolino --- configure.ac | 1 - include/builddefs.in | 1 - io/Makefile | 5 ----- io/pread.c | 8 -------- io/pwrite.c | 8 -------- m4/package_libcdev.m4 | 19 ------------------- 6 files changed, 42 deletions(-) diff --git a/configure.ac b/configure.ac index 4d4ce905..66feba8f 100644 --- a/configure.ac +++ b/configure.ac @@ -163,7 +163,6 @@ AC_PACKAGE_NEED_URCU_H AC_PACKAGE_NEED_RCU_INIT AC_HAVE_PWRITEV2 -AC_HAVE_PREADV AC_HAVE_COPY_FILE_RANGE AC_HAVE_FSETXATTR AC_HAVE_MREMAP diff --git a/include/builddefs.in b/include/builddefs.in index b516ba9e..f0c59b39 100644 --- a/include/builddefs.in +++ b/include/builddefs.in @@ -90,7 +90,6 @@ ENABLE_SCRUB = @enable_scrub@ HAVE_ZIPPED_MANPAGES = @have_zipped_manpages@ -HAVE_PREADV = @have_preadv@ HAVE_PWRITEV2 = @have_pwritev2@ HAVE_COPY_FILE_RANGE = @have_copy_file_range@ HAVE_FSETXATTR = @have_fsetxattr@ diff --git a/io/Makefile b/io/Makefile index acef8957..a81a75fc 100644 --- a/io/Makefile +++ b/io/Makefile @@ -29,11 +29,6 @@ ifeq ($(ENABLE_EDITLINE),yes) LLDLIBS += $(LIBEDITLINE) $(LIBTERMCAP) endif -# Also implies PWRITEV -ifeq ($(HAVE_PREADV),yes) -LCFLAGS += -DHAVE_PREADV -DHAVE_PWRITEV -endif - ifeq ($(HAVE_PWRITEV2),yes) LCFLAGS += -DHAVE_PWRITEV2 endif diff --git a/io/pread.c b/io/pread.c index 79990c6a..62c771fb 100644 --- a/io/pread.c +++ b/io/pread.c @@ -37,9 +37,7 @@ pread_help(void) " -R -- read at random offsets in the range of bytes\n" " -Z N -- zeed the random number generator (used when reading randomly)\n" " (heh, zorry, the -s/-S arguments were already in use in pwrite)\n" -#ifdef HAVE_PREADV " -V N -- use vectored IO with N iovecs of blocksize each (preadv)\n" -#endif "\n" " When in \"random\" mode, the number of read operations will equal the\n" " number required to do a complete forward/backward scan of the range.\n" @@ -160,7 +158,6 @@ dump_buffer( } } -#ifdef HAVE_PREADV static ssize_t do_preadv( int fd, @@ -192,9 +189,6 @@ do_preadv( return bytes; } -#else -#define do_preadv(fd, offset, count) (0) -#endif static ssize_t do_pread( @@ -414,7 +408,6 @@ pread_f( case 'v': vflag = 1; break; -#ifdef HAVE_PREADV case 'V': vectors = strtoul(optarg, &sp, 0); if (!sp || sp == optarg) { @@ -424,7 +417,6 @@ pread_f( return 0; } break; -#endif case 'Z': zeed = strtoul(optarg, &sp, 0); if (!sp || sp == optarg) { diff --git a/io/pwrite.c b/io/pwrite.c index 8d134c56..a88cecc7 100644 --- a/io/pwrite.c +++ b/io/pwrite.c @@ -40,9 +40,7 @@ pwrite_help(void) " -R -- write at random offsets in the specified range of bytes\n" " -Z N -- zeed the random number generator (used when writing randomly)\n" " (heh, zorry, the -s/-S arguments were already in use in pwrite)\n" -#ifdef HAVE_PWRITEV " -V N -- use vectored IO with N iovecs of blocksize each (pwritev)\n" -#endif #ifdef HAVE_PWRITEV2 " -N -- Perform the pwritev2() with RWF_NOWAIT\n" " -D -- Perform the pwritev2() with RWF_DSYNC\n" @@ -50,7 +48,6 @@ pwrite_help(void) "\n")); } -#ifdef HAVE_PWRITEV static ssize_t do_pwritev( int fd, @@ -90,9 +87,6 @@ do_pwritev( return bytes; } -#else -#define do_pwritev(fd, offset, count, pwritev2_flags) (0) -#endif static ssize_t do_pwrite( @@ -353,7 +347,6 @@ pwrite_f( case 'u': uflag = 1; break; -#ifdef HAVE_PWRITEV case 'V': vectors = strtoul(optarg, &sp, 0); if (!sp || sp == optarg) { @@ -363,7 +356,6 @@ pwrite_f( return 0; } break; -#endif case 'w': wflag = 1; break; diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 index 37d11e33..7d7679fa 100644 --- a/m4/package_libcdev.m4 +++ b/m4/package_libcdev.m4 @@ -1,22 +1,3 @@ -# -# Check if we have a preadv libc call (Linux) -# -AC_DEFUN([AC_HAVE_PREADV], - [ AC_MSG_CHECKING([for preadv]) - AC_LINK_IFELSE( - [ AC_LANG_PROGRAM([[ -#define _BSD_SOURCE -#define _DEFAULT_SOURCE -#include - ]], [[ -preadv(0, 0, 0, 0); - ]]) - ], have_preadv=yes - AC_MSG_RESULT(yes), - AC_MSG_RESULT(no)) - AC_SUBST(have_preadv) - ]) - # # Check if we have a pwritev2 libc call (Linux) # -- 2.39.5