Separate io_u from ioengine [3/3] - rename ioengine.h to ioengines.h
authorTomohiro Kusumi <tkusumi@tuxera.com>
Tue, 28 Mar 2017 20:03:01 +0000 (23:03 +0300)
committerJens Axboe <axboe@fb.com>
Tue, 28 Mar 2017 21:14:20 +0000 (15:14 -0600)
This is based on the previous commits which added a new header
io_u.h and separated io_u related from ioengine.h and ioengines.c.

Since now that ioengine.h and ioengines.c are 1:1 in their contents
(i.e. prototypes and implementation), they should be based on the
same name as well.

This could possibly break outbox ioengines if they include ioengine.h,
but all the inbox ones just include fio.h (probably because that's
what engines/skeleton_external.c does), so the impact is probably
limited, and fio doesn't guarantee anything to outbox ones anyway.

Signed-off-by: Tomohiro Kusumi <tkusumi@tuxera.com>
Signed-off-by: Jens Axboe <axboe@fb.com>
fio.h
ioengine.h [deleted file]
ioengines.h [new file with mode: 0644]
iolog.h
rate-submit.c

diff --git a/fio.h b/fio.h
index 806f7ed55bf5a46e9f71bf4c525639436eca5307..3955a819804290c37aee71aaf153333fb69d7ebc 100644 (file)
--- a/fio.h
+++ b/fio.h
@@ -25,7 +25,7 @@
 #include "debug.h"
 #include "file.h"
 #include "io_ddir.h"
 #include "debug.h"
 #include "file.h"
 #include "io_ddir.h"
-#include "ioengine.h"
+#include "ioengines.h"
 #include "iolog.h"
 #include "helpers.h"
 #include "options.h"
 #include "iolog.h"
 #include "helpers.h"
 #include "options.h"
diff --git a/ioengine.h b/ioengine.h
deleted file mode 100644 (file)
index f24f4df..0000000
+++ /dev/null
@@ -1,90 +0,0 @@
-#ifndef FIO_IOENGINE_H
-#define FIO_IOENGINE_H
-
-#include "compiler/compiler.h"
-#include "os/os.h"
-#include "file.h"
-#include "io_u.h"
-
-#define FIO_IOOPS_VERSION      23
-
-/*
- * io_ops->queue() return values
- */
-enum {
-       FIO_Q_COMPLETED = 0,            /* completed sync */
-       FIO_Q_QUEUED    = 1,            /* queued, will complete async */
-       FIO_Q_BUSY      = 2,            /* no more room, call ->commit() */
-};
-
-struct ioengine_ops {
-       struct flist_head list;
-       const char *name;
-       int version;
-       int flags;
-       int (*setup)(struct thread_data *);
-       int (*init)(struct thread_data *);
-       int (*prep)(struct thread_data *, struct io_u *);
-       int (*queue)(struct thread_data *, struct io_u *);
-       int (*commit)(struct thread_data *);
-       int (*getevents)(struct thread_data *, unsigned int, unsigned int, const struct timespec *);
-       struct io_u *(*event)(struct thread_data *, int);
-       char *(*errdetails)(struct io_u *);
-       int (*cancel)(struct thread_data *, struct io_u *);
-       void (*cleanup)(struct thread_data *);
-       int (*open_file)(struct thread_data *, struct fio_file *);
-       int (*close_file)(struct thread_data *, struct fio_file *);
-       int (*invalidate)(struct thread_data *, struct fio_file *);
-       int (*unlink_file)(struct thread_data *, struct fio_file *);
-       int (*get_file_size)(struct thread_data *, struct fio_file *);
-       void (*terminate)(struct thread_data *);
-       int (*iomem_alloc)(struct thread_data *, size_t);
-       void (*iomem_free)(struct thread_data *);
-       int (*io_u_init)(struct thread_data *, struct io_u *);
-       void (*io_u_free)(struct thread_data *, struct io_u *);
-       int option_struct_size;
-       struct fio_option *options;
-};
-
-enum fio_ioengine_flags {
-       FIO_SYNCIO      = 1 << 0,       /* io engine has synchronous ->queue */
-       FIO_RAWIO       = 1 << 1,       /* some sort of direct/raw io */
-       FIO_DISKLESSIO  = 1 << 2,       /* no disk involved */
-       FIO_NOEXTEND    = 1 << 3,       /* engine can't extend file */
-       FIO_NODISKUTIL  = 1 << 4,       /* diskutil can't handle filename */
-       FIO_UNIDIR      = 1 << 5,       /* engine is uni-directional */
-       FIO_NOIO        = 1 << 6,       /* thread does only pseudo IO */
-       FIO_PIPEIO      = 1 << 7,       /* input/output no seekable */
-       FIO_BARRIER     = 1 << 8,       /* engine supports barriers */
-       FIO_MEMALIGN    = 1 << 9,       /* engine wants aligned memory */
-       FIO_BIT_BASED   = 1 << 10,      /* engine uses a bit base (e.g. uses Kbit as opposed to KB) */
-       FIO_FAKEIO      = 1 << 11,      /* engine pretends to do IO */
-};
-
-/*
- * External engine defined symbol to fill in the engine ops structure
- */
-typedef void (*get_ioengine_t)(struct ioengine_ops **);
-
-/*
- * io engine entry points
- */
-extern int __must_check td_io_init(struct thread_data *);
-extern int __must_check td_io_prep(struct thread_data *, struct io_u *);
-extern int __must_check td_io_queue(struct thread_data *, struct io_u *);
-extern int __must_check td_io_getevents(struct thread_data *, unsigned int, unsigned int, const struct timespec *);
-extern int __must_check td_io_commit(struct thread_data *);
-extern int __must_check td_io_open_file(struct thread_data *, struct fio_file *);
-extern int td_io_close_file(struct thread_data *, struct fio_file *);
-extern int td_io_unlink_file(struct thread_data *, struct fio_file *);
-extern int __must_check td_io_get_file_size(struct thread_data *, struct fio_file *);
-
-extern struct ioengine_ops *load_ioengine(struct thread_data *, const char *);
-extern void register_ioengine(struct ioengine_ops *);
-extern void unregister_ioengine(struct ioengine_ops *);
-extern void free_ioengine(struct thread_data *);
-extern void close_ioengine(struct thread_data *);
-
-extern int fio_show_ioengine_help(const char *engine);
-
-#endif
diff --git a/ioengines.h b/ioengines.h
new file mode 100644 (file)
index 0000000..f24f4df
--- /dev/null
@@ -0,0 +1,90 @@
+#ifndef FIO_IOENGINE_H
+#define FIO_IOENGINE_H
+
+#include "compiler/compiler.h"
+#include "os/os.h"
+#include "file.h"
+#include "io_u.h"
+
+#define FIO_IOOPS_VERSION      23
+
+/*
+ * io_ops->queue() return values
+ */
+enum {
+       FIO_Q_COMPLETED = 0,            /* completed sync */
+       FIO_Q_QUEUED    = 1,            /* queued, will complete async */
+       FIO_Q_BUSY      = 2,            /* no more room, call ->commit() */
+};
+
+struct ioengine_ops {
+       struct flist_head list;
+       const char *name;
+       int version;
+       int flags;
+       int (*setup)(struct thread_data *);
+       int (*init)(struct thread_data *);
+       int (*prep)(struct thread_data *, struct io_u *);
+       int (*queue)(struct thread_data *, struct io_u *);
+       int (*commit)(struct thread_data *);
+       int (*getevents)(struct thread_data *, unsigned int, unsigned int, const struct timespec *);
+       struct io_u *(*event)(struct thread_data *, int);
+       char *(*errdetails)(struct io_u *);
+       int (*cancel)(struct thread_data *, struct io_u *);
+       void (*cleanup)(struct thread_data *);
+       int (*open_file)(struct thread_data *, struct fio_file *);
+       int (*close_file)(struct thread_data *, struct fio_file *);
+       int (*invalidate)(struct thread_data *, struct fio_file *);
+       int (*unlink_file)(struct thread_data *, struct fio_file *);
+       int (*get_file_size)(struct thread_data *, struct fio_file *);
+       void (*terminate)(struct thread_data *);
+       int (*iomem_alloc)(struct thread_data *, size_t);
+       void (*iomem_free)(struct thread_data *);
+       int (*io_u_init)(struct thread_data *, struct io_u *);
+       void (*io_u_free)(struct thread_data *, struct io_u *);
+       int option_struct_size;
+       struct fio_option *options;
+};
+
+enum fio_ioengine_flags {
+       FIO_SYNCIO      = 1 << 0,       /* io engine has synchronous ->queue */
+       FIO_RAWIO       = 1 << 1,       /* some sort of direct/raw io */
+       FIO_DISKLESSIO  = 1 << 2,       /* no disk involved */
+       FIO_NOEXTEND    = 1 << 3,       /* engine can't extend file */
+       FIO_NODISKUTIL  = 1 << 4,       /* diskutil can't handle filename */
+       FIO_UNIDIR      = 1 << 5,       /* engine is uni-directional */
+       FIO_NOIO        = 1 << 6,       /* thread does only pseudo IO */
+       FIO_PIPEIO      = 1 << 7,       /* input/output no seekable */
+       FIO_BARRIER     = 1 << 8,       /* engine supports barriers */
+       FIO_MEMALIGN    = 1 << 9,       /* engine wants aligned memory */
+       FIO_BIT_BASED   = 1 << 10,      /* engine uses a bit base (e.g. uses Kbit as opposed to KB) */
+       FIO_FAKEIO      = 1 << 11,      /* engine pretends to do IO */
+};
+
+/*
+ * External engine defined symbol to fill in the engine ops structure
+ */
+typedef void (*get_ioengine_t)(struct ioengine_ops **);
+
+/*
+ * io engine entry points
+ */
+extern int __must_check td_io_init(struct thread_data *);
+extern int __must_check td_io_prep(struct thread_data *, struct io_u *);
+extern int __must_check td_io_queue(struct thread_data *, struct io_u *);
+extern int __must_check td_io_getevents(struct thread_data *, unsigned int, unsigned int, const struct timespec *);
+extern int __must_check td_io_commit(struct thread_data *);
+extern int __must_check td_io_open_file(struct thread_data *, struct fio_file *);
+extern int td_io_close_file(struct thread_data *, struct fio_file *);
+extern int td_io_unlink_file(struct thread_data *, struct fio_file *);
+extern int __must_check td_io_get_file_size(struct thread_data *, struct fio_file *);
+
+extern struct ioengine_ops *load_ioengine(struct thread_data *, const char *);
+extern void register_ioengine(struct ioengine_ops *);
+extern void unregister_ioengine(struct ioengine_ops *);
+extern void free_ioengine(struct thread_data *);
+extern void close_ioengine(struct thread_data *);
+
+extern int fio_show_ioengine_help(const char *engine);
+
+#endif
diff --git a/iolog.h b/iolog.h
index 37f27bcafb94df1fe7cac3f23f99f0bc4a0c0131..0733ad33c3c8b5872b3f3f897a299f9b41d1e606 100644 (file)
--- a/iolog.h
+++ b/iolog.h
@@ -4,7 +4,7 @@
 #include "lib/rbtree.h"
 #include "lib/ieee754.h"
 #include "flist.h"
 #include "lib/rbtree.h"
 #include "lib/ieee754.h"
 #include "flist.h"
-#include "ioengine.h"
+#include "ioengines.h"
 
 /*
  * Use for maintaining statistics
 
 /*
  * Use for maintaining statistics
index 4738dc4c06d0e158ddeb752a590b38124dcda6a7..fdbece64d877ee0edd1e0f5359e2222db611483d 100644 (file)
@@ -5,7 +5,7 @@
  *
  */
 #include "fio.h"
  *
  */
 #include "fio.h"
-#include "ioengine.h"
+#include "ioengines.h"
 #include "lib/getrusage.h"
 #include "rate-submit.h"
 
 #include "lib/getrusage.h"
 #include "rate-submit.h"