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