Blame SOURCES/0001-fio-remove-raw-device-support.patch

fd38b0
From 382975557e632efb506836bc1709789e615c9094 Mon Sep 17 00:00:00 2001
fd38b0
From: Eric Sandeen <esandeen@redhat.com>
fd38b0
Date: Tue, 3 Aug 2021 10:23:35 -0700
fd38b0
Subject: [PATCH] fio: remove raw device support
fd38b0
fd38b0
As of Linux kernel commit 603e4922f1c ("remove the raw driver"),
fd38b0
linux/raw.h is gone, and raw device support no longer exists.
fd38b0
Because of this, fio can no longer build against the current Linux
fd38b0
kernel headers.
fd38b0
fd38b0
So, remove raw device support from fio as well.
fd38b0
fd38b0
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
fd38b0
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fd38b0
---
fd38b0
 diskutil.c    | 10 +++-------
fd38b0
 fio.1         |  4 +---
fd38b0
 os/os-linux.h | 32 --------------------------------
fd38b0
 os/os.h       |  4 ----
fd38b0
 4 files changed, 4 insertions(+), 46 deletions(-)
fd38b0
fd38b0
diff --git a/diskutil.c b/diskutil.c
fd38b0
index 0051a7a0..ace7af3d 100644
fd38b0
--- a/diskutil.c
fd38b0
+++ b/diskutil.c
fd38b0
@@ -166,14 +166,10 @@ static int get_device_numbers(char *file_name, int *maj, int *min)
fd38b0
 		if (S_ISBLK(st.st_mode)) {
fd38b0
 			majdev = major(st.st_rdev);
fd38b0
 			mindev = minor(st.st_rdev);
fd38b0
-		} else if (S_ISCHR(st.st_mode)) {
fd38b0
-			majdev = major(st.st_rdev);
fd38b0
-			mindev = minor(st.st_rdev);
fd38b0
-			if (fio_lookup_raw(st.st_rdev, &majdev, &mindev))
fd38b0
-				return -1;
fd38b0
-		} else if (S_ISFIFO(st.st_mode))
fd38b0
+		} else if (S_ISCHR(st.st_mode) ||
fd38b0
+			   S_ISFIFO(st.st_mode)) {
fd38b0
 			return -1;
fd38b0
-		else {
fd38b0
+		} else {
fd38b0
 			majdev = major(st.st_dev);
fd38b0
 			mindev = minor(st.st_dev);
fd38b0
 		}
fd38b0
diff --git a/fio.1 b/fio.1
fd38b0
index 6cc82542..9c12ad13 100644
fd38b0
--- a/fio.1
fd38b0
+++ b/fio.1
fd38b0
@@ -1700,9 +1700,7 @@ Sets size to something really large and waits for ENOSPC (no space left on
fd38b0
 device) or EDQUOT (disk quota exceeded)
fd38b0
 as the terminating condition. Only makes sense with sequential
fd38b0
 write. For a read workload, the mount point will be filled first then I/O
fd38b0
-started on the result. This option doesn't make sense if operating on a raw
fd38b0
-device node, since the size of that is already known by the file system.
fd38b0
-Additionally, writing beyond end-of-device will not return ENOSPC there.
fd38b0
+started on the result.
fd38b0
 .SS "I/O engine"
fd38b0
 .TP
fd38b0
 .BI ioengine \fR=\fPstr
fd38b0
diff --git a/os/os-linux.h b/os/os-linux.h
fd38b0
index f7137abe..16ed5258 100644
fd38b0
--- a/os/os-linux.h
fd38b0
+++ b/os/os-linux.h
fd38b0
@@ -14,7 +14,6 @@
fd38b0
 #include <errno.h>
fd38b0
 #include <sched.h>
fd38b0
 #include <linux/unistd.h>
fd38b0
-#include <linux/raw.h>
fd38b0
 #include <linux/major.h>
fd38b0
 #include <linux/fs.h>
fd38b0
 #include <scsi/sg.h>
fd38b0
@@ -41,7 +40,6 @@
fd38b0
 #define FIO_HAVE_IOSCHED_SWITCH
fd38b0
 #define FIO_HAVE_ODIRECT
fd38b0
 #define FIO_HAVE_HUGETLB
fd38b0
-#define FIO_HAVE_RAWBIND
fd38b0
 #define FIO_HAVE_BLKTRACE
fd38b0
 #define FIO_HAVE_CL_SIZE
fd38b0
 #define FIO_HAVE_CGROUPS
fd38b0
@@ -178,36 +176,6 @@ static inline unsigned long long os_phys_mem(void)
fd38b0
 	return (unsigned long long) pages * (unsigned long long) pagesize;
fd38b0
 }
fd38b0
 
fd38b0
-static inline int fio_lookup_raw(dev_t dev, int *majdev, int *mindev)
fd38b0
-{
fd38b0
-	struct raw_config_request rq;
fd38b0
-	int fd;
fd38b0
-
fd38b0
-	if (major(dev) != RAW_MAJOR)
fd38b0
-		return 1;
fd38b0
-
fd38b0
-	/*
fd38b0
-	 * we should be able to find /dev/rawctl or /dev/raw/rawctl
fd38b0
-	 */
fd38b0
-	fd = open("/dev/rawctl", O_RDONLY);
fd38b0
-	if (fd < 0) {
fd38b0
-		fd = open("/dev/raw/rawctl", O_RDONLY);
fd38b0
-		if (fd < 0)
fd38b0
-			return 1;
fd38b0
-	}
fd38b0
-
fd38b0
-	rq.raw_minor = minor(dev);
fd38b0
-	if (ioctl(fd, RAW_GETBIND, &rq) < 0) {
fd38b0
-		close(fd);
fd38b0
-		return 1;
fd38b0
-	}
fd38b0
-
fd38b0
-	close(fd);
fd38b0
-	*majdev = rq.block_major;
fd38b0
-	*mindev = rq.block_minor;
fd38b0
-	return 0;
fd38b0
-}
fd38b0
-
fd38b0
 #ifdef O_NOATIME
fd38b0
 #define FIO_O_NOATIME	O_NOATIME
fd38b0
 #else
fd38b0
diff --git a/os/os.h b/os/os.h
fd38b0
index e47d3d97..17daf91d 100644
fd38b0
--- a/os/os.h
fd38b0
+++ b/os/os.h
fd38b0
@@ -157,10 +157,6 @@ extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);
fd38b0
 #define OS_RAND_MAX			RAND_MAX
fd38b0
 #endif
fd38b0
 
fd38b0
-#ifndef FIO_HAVE_RAWBIND
fd38b0
-#define fio_lookup_raw(dev, majdev, mindev)	1
fd38b0
-#endif
fd38b0
-
fd38b0
 #ifndef FIO_PREFERRED_ENGINE
fd38b0
 #define FIO_PREFERRED_ENGINE	"psync"
fd38b0
 #endif
fd38b0
-- 
fd38b0
2.17.0
fd38b0