fio: remove raw device support
authorEric Sandeen <esandeen@redhat.com>
Tue, 3 Aug 2021 17:23:35 +0000 (10:23 -0700)
committerJens Axboe <axboe@kernel.dk>
Tue, 3 Aug 2021 18:20:22 +0000 (12:20 -0600)
As of Linux kernel commit 603e4922f1c ("remove the raw driver"),
linux/raw.h is gone, and raw device support no longer exists.
Because of this, fio can no longer build against the current Linux
kernel headers.

So, remove raw device support from fio as well.

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
diskutil.c
fio.1
os/os-linux.h
os/os.h

index 0051a7a035875b3a51493ac527125b413ad1bb7d..ace7af3d5b5bb7368584a1369a0872cbe79c92ee 100644 (file)
@@ -166,14 +166,10 @@ static int get_device_numbers(char *file_name, int *maj, int *min)
                if (S_ISBLK(st.st_mode)) {
                        majdev = major(st.st_rdev);
                        mindev = minor(st.st_rdev);
-               } else if (S_ISCHR(st.st_mode)) {
-                       majdev = major(st.st_rdev);
-                       mindev = minor(st.st_rdev);
-                       if (fio_lookup_raw(st.st_rdev, &majdev, &mindev))
-                               return -1;
-               } else if (S_ISFIFO(st.st_mode))
+               } else if (S_ISCHR(st.st_mode) ||
+                          S_ISFIFO(st.st_mode)) {
                        return -1;
-               else {
+               else {
                        majdev = major(st.st_dev);
                        mindev = minor(st.st_dev);
                }
diff --git a/fio.1 b/fio.1
index 6cc82542fcb786285dbdf5da311f5d371d38f56d..9c12ad1318b7e130aacf403fc5e8375eb5d87f9b 100644 (file)
--- a/fio.1
+++ b/fio.1
@@ -1700,9 +1700,7 @@ Sets size to something really large and waits for ENOSPC (no space left on
 device) or EDQUOT (disk quota exceeded)
 as the terminating condition. Only makes sense with sequential
 write. For a read workload, the mount point will be filled first then I/O
-started on the result. This option doesn't make sense if operating on a raw
-device node, since the size of that is already known by the file system.
-Additionally, writing beyond end-of-device will not return ENOSPC there.
+started on the result.
 .SS "I/O engine"
 .TP
 .BI ioengine \fR=\fPstr
index f7137abe1b872a9821cfa4ea73dd799627597f5c..16ed525881144cd190eb6457f5b313c6cf5d9188 100644 (file)
@@ -14,7 +14,6 @@
 #include <errno.h>
 #include <sched.h>
 #include <linux/unistd.h>
-#include <linux/raw.h>
 #include <linux/major.h>
 #include <linux/fs.h>
 #include <scsi/sg.h>
@@ -41,7 +40,6 @@
 #define FIO_HAVE_IOSCHED_SWITCH
 #define FIO_HAVE_ODIRECT
 #define FIO_HAVE_HUGETLB
-#define FIO_HAVE_RAWBIND
 #define FIO_HAVE_BLKTRACE
 #define FIO_HAVE_CL_SIZE
 #define FIO_HAVE_CGROUPS
@@ -178,36 +176,6 @@ static inline unsigned long long os_phys_mem(void)
        return (unsigned long long) pages * (unsigned long long) pagesize;
 }
 
-static inline int fio_lookup_raw(dev_t dev, int *majdev, int *mindev)
-{
-       struct raw_config_request rq;
-       int fd;
-
-       if (major(dev) != RAW_MAJOR)
-               return 1;
-
-       /*
-        * we should be able to find /dev/rawctl or /dev/raw/rawctl
-        */
-       fd = open("/dev/rawctl", O_RDONLY);
-       if (fd < 0) {
-               fd = open("/dev/raw/rawctl", O_RDONLY);
-               if (fd < 0)
-                       return 1;
-       }
-
-       rq.raw_minor = minor(dev);
-       if (ioctl(fd, RAW_GETBIND, &rq) < 0) {
-               close(fd);
-               return 1;
-       }
-
-       close(fd);
-       *majdev = rq.block_major;
-       *mindev = rq.block_minor;
-       return 0;
-}
-
 #ifdef O_NOATIME
 #define FIO_O_NOATIME  O_NOATIME
 #else
diff --git a/os/os.h b/os/os.h
index e47d3d97064e2b897a9036f680470caf2b3b4f45..17daf91d6f39ed16cb01f1637f5ce68db2ff5134 100644 (file)
--- a/os/os.h
+++ b/os/os.h
@@ -157,10 +157,6 @@ extern int fio_cpus_split(os_cpu_mask_t *mask, unsigned int cpu);
 #define OS_RAND_MAX                    RAND_MAX
 #endif
 
-#ifndef FIO_HAVE_RAWBIND
-#define fio_lookup_raw(dev, majdev, mindev)    1
-#endif
-
 #ifndef FIO_PREFERRED_ENGINE
 #define FIO_PREFERRED_ENGINE   "psync"
 #endif