Remove dead code from fio_io_sync()
[fio.git] / ioengines.h
... / ...
CommitLineData
1#ifndef FIO_IOENGINE_H
2#define FIO_IOENGINE_H
3
4#include <stddef.h>
5
6#include "compiler/compiler.h"
7#include "flist.h"
8#include "io_u.h"
9
10#define FIO_IOOPS_VERSION 23
11
12/*
13 * io_ops->queue() return values
14 */
15enum {
16 FIO_Q_COMPLETED = 0, /* completed sync */
17 FIO_Q_QUEUED = 1, /* queued, will complete async */
18 FIO_Q_BUSY = 2, /* no more room, call ->commit() */
19};
20
21struct ioengine_ops {
22 struct flist_head list;
23 const char *name;
24 int version;
25 int flags;
26 int (*setup)(struct thread_data *);
27 int (*init)(struct thread_data *);
28 int (*prep)(struct thread_data *, struct io_u *);
29 int (*queue)(struct thread_data *, struct io_u *);
30 int (*commit)(struct thread_data *);
31 int (*getevents)(struct thread_data *, unsigned int, unsigned int, const struct timespec *);
32 struct io_u *(*event)(struct thread_data *, int);
33 char *(*errdetails)(struct io_u *);
34 int (*cancel)(struct thread_data *, struct io_u *);
35 void (*cleanup)(struct thread_data *);
36 int (*open_file)(struct thread_data *, struct fio_file *);
37 int (*close_file)(struct thread_data *, struct fio_file *);
38 int (*invalidate)(struct thread_data *, struct fio_file *);
39 int (*unlink_file)(struct thread_data *, struct fio_file *);
40 int (*get_file_size)(struct thread_data *, struct fio_file *);
41 void (*terminate)(struct thread_data *);
42 int (*iomem_alloc)(struct thread_data *, size_t);
43 void (*iomem_free)(struct thread_data *);
44 int (*io_u_init)(struct thread_data *, struct io_u *);
45 void (*io_u_free)(struct thread_data *, struct io_u *);
46 int option_struct_size;
47 struct fio_option *options;
48};
49
50enum fio_ioengine_flags {
51 FIO_SYNCIO = 1 << 0, /* io engine has synchronous ->queue */
52 FIO_RAWIO = 1 << 1, /* some sort of direct/raw io */
53 FIO_DISKLESSIO = 1 << 2, /* no disk involved */
54 FIO_NOEXTEND = 1 << 3, /* engine can't extend file */
55 FIO_NODISKUTIL = 1 << 4, /* diskutil can't handle filename */
56 FIO_UNIDIR = 1 << 5, /* engine is uni-directional */
57 FIO_NOIO = 1 << 6, /* thread does only pseudo IO */
58 FIO_PIPEIO = 1 << 7, /* input/output no seekable */
59 FIO_BARRIER = 1 << 8, /* engine supports barriers */
60 FIO_MEMALIGN = 1 << 9, /* engine wants aligned memory */
61 FIO_BIT_BASED = 1 << 10, /* engine uses a bit base (e.g. uses Kbit as opposed to KB) */
62 FIO_FAKEIO = 1 << 11, /* engine pretends to do IO */
63 FIO_NOSTATS = 1 << 12, /* don't do IO stats */
64 FIO_NOFILEHASH = 1 << 13, /* doesn't hash the files for lookup later. */
65};
66
67/*
68 * External engine defined symbol to fill in the engine ops structure
69 */
70typedef void (*get_ioengine_t)(struct ioengine_ops **);
71
72/*
73 * io engine entry points
74 */
75extern int __must_check td_io_init(struct thread_data *);
76extern int __must_check td_io_prep(struct thread_data *, struct io_u *);
77extern int __must_check td_io_queue(struct thread_data *, struct io_u *);
78extern int __must_check td_io_getevents(struct thread_data *, unsigned int, unsigned int, const struct timespec *);
79extern void td_io_commit(struct thread_data *);
80extern int __must_check td_io_open_file(struct thread_data *, struct fio_file *);
81extern int td_io_close_file(struct thread_data *, struct fio_file *);
82extern int td_io_unlink_file(struct thread_data *, struct fio_file *);
83extern int __must_check td_io_get_file_size(struct thread_data *, struct fio_file *);
84
85extern struct ioengine_ops *load_ioengine(struct thread_data *);
86extern void register_ioengine(struct ioengine_ops *);
87extern void unregister_ioengine(struct ioengine_ops *);
88extern void free_ioengine(struct thread_data *);
89extern void close_ioengine(struct thread_data *);
90
91extern int fio_show_ioengine_help(const char *engine);
92
93#endif