[PATCH 27/27] configure: don't check for HDIO_GETGEO

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



HDIO_GETGEO has been around longer than XFS.

Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
 configure.ac          |  1 -
 include/builddefs.in  |  1 -
 m4/package_libcdev.m4 | 19 -------------------
 scrub/Makefile        |  4 ----
 scrub/disk.c          |  8 +-------
 5 files changed, 1 insertion(+), 32 deletions(-)

diff --git a/configure.ac b/configure.ac
index db967055b..d85a6e774 100644
--- a/configure.ac
+++ b/configure.ac
@@ -181,7 +181,6 @@ if test "$enable_scrub" = "yes"; then
                 AC_MSG_ERROR([libicu not found.])
         fi
 fi
-AC_HAVE_HDIO_GETGEO
 AC_CONFIG_SYSTEMD_SYSTEM_UNIT_DIR
 AC_CONFIG_CROND_DIR
 AC_CONFIG_UDEV_RULE_DIR
diff --git a/include/builddefs.in b/include/builddefs.in
index 61981fc6a..aa69859c0 100644
--- a/include/builddefs.in
+++ b/include/builddefs.in
@@ -101,7 +101,6 @@ HAVE_DEVMAPPER = @have_devmapper@
 HAVE_MALLINFO2 = @have_mallinfo2@
 HAVE_LIBATTR = @have_libattr@
 HAVE_LIBICU = @have_libicu@
-HAVE_HDIO_GETGEO = @have_hdio_getgeo@
 HAVE_SYSTEMD = @have_systemd@
 SYSTEMD_SYSTEM_UNIT_DIR = @systemd_system_unit_dir@
 HAVE_CROND = @have_crond@
diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4
index a85894a11..13dcdec1b 100644
--- a/m4/package_libcdev.m4
+++ b/m4/package_libcdev.m4
@@ -157,25 +157,6 @@ test = mallinfo2();
     AC_SUBST(have_mallinfo2)
   ])
 
-#
-# Check if we have the HDIO_GETGEO ioctl
-#
-AC_DEFUN([AC_HAVE_HDIO_GETGEO],
-  [ AC_MSG_CHECKING([for struct hd_geometry ])
-    AC_COMPILE_IFELSE(
-    [	AC_LANG_PROGRAM([[
-#include <linux/hdreg.h>
-#include <sys/ioctl.h>
-	]], [[
-struct hd_geometry hdr;
-ioctl(0, HDIO_GETGEO, &hdr);
-	]])
-    ], have_hdio_getgeo=yes
-       AC_MSG_RESULT(yes),
-       AC_MSG_RESULT(no))
-    AC_SUBST(have_hdio_getgeo)
-  ])
-
 AC_DEFUN([AC_PACKAGE_CHECK_LTO],
   [ AC_MSG_CHECKING([if C compiler supports LTO])
     OLD_CFLAGS="$CFLAGS"
diff --git a/scrub/Makefile b/scrub/Makefile
index f9dfb016f..9bb485f91 100644
--- a/scrub/Makefile
+++ b/scrub/Makefile
@@ -94,10 +94,6 @@ CFILES += unicrash.c
 LCFLAGS += -DHAVE_LIBICU $(LIBICU_CFLAGS)
 endif
 
-ifeq ($(HAVE_HDIO_GETGEO),yes)
-LCFLAGS += -DHAVE_HDIO_GETGEO
-endif
-
 LDIRT = $(XFS_SCRUB_ALL_PROG) $(XFS_SCRUB_FAIL_PROG) *.service *.cron
 
 default: depend $(LTCOMMAND) $(XFS_SCRUB_ALL_PROG) $(XFS_SCRUB_FAIL_PROG) $(OPTIONAL_TARGETS)
diff --git a/scrub/disk.c b/scrub/disk.c
index 0ec29d965..2cf84d918 100644
--- a/scrub/disk.c
+++ b/scrub/disk.c
@@ -11,9 +11,7 @@
 #include <sys/types.h>
 #include <sys/statvfs.h>
 #include <scsi/sg.h>
-#ifdef HAVE_HDIO_GETGEO
-# include <linux/hdreg.h>
-#endif
+#include <linux/hdreg.h>
 #include "platform_defs.h"
 #include "libfrog/util.h"
 #include "libfrog/paths.h"
@@ -184,9 +182,7 @@ struct disk *
 disk_open(
 	const char		*pathname)
 {
-#ifdef HAVE_HDIO_GETGEO
 	struct hd_geometry	bdgeo;
-#endif
 	struct disk		*disk;
 	bool			suspicious_disk = false;
 	int			error;
@@ -218,7 +214,6 @@ disk_open(
 		error = ioctl(disk->d_fd, BLKBSZGET, &disk->d_blksize);
 		if (error)
 			disk->d_blksize = 0;
-#ifdef HAVE_HDIO_GETGEO
 		error = ioctl(disk->d_fd, HDIO_GETGEO, &bdgeo);
 		if (!error) {
 			/*
@@ -234,7 +229,6 @@ disk_open(
 				suspicious_disk = true;
 			disk->d_start = bdgeo.start << BBSHIFT;
 		} else
-#endif
 			disk->d_start = 0;
 	} else {
 		disk->d_size = disk->d_sb.st_size;
-- 
2.39.2





[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux