}
static int fio_binject_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec fio_unused *t)
+ unsigned int max,
+ const struct timespec fio_unused *t)
{
struct binject_data *bd = td->io_ops->data;
int left = max, ret, r = 0, ev_index = 0;
}
static int fio_gf_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max, const struct timespec *t)
{
struct gf_data *g = td->io_ops->data;
unsigned int events = 0;
}
static int fio_guasi_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max, const struct timespec *t)
{
struct guasi_data *ld = td->io_ops->data;
int n, r;
}
static int fio_libaio_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max, const struct timespec *t)
{
struct libaio_data *ld = td->io_ops->data;
struct libaio_options *o = td->eo;
unsigned actual_min = td->o.iodepth_batch_complete == 0 ? 0 : min;
+ struct timespec __lt, *lt = NULL;
int r, events = 0;
+ if (t) {
+ __lt = *t;
+ lt = &__lt;
+ }
+
do {
if (o->userspace_reap == 1
&& actual_min == 0
ld->aio_events + events);
} else {
r = io_getevents(ld->aio_ctx, actual_min,
- max, ld->aio_events + events, t);
+ max, ld->aio_events + events, lt);
}
if (r >= 0)
events += r;
static int fio_null_getevents(struct thread_data *td, unsigned int min_events,
unsigned int fio_unused max,
- struct timespec fio_unused *t)
+ const struct timespec fio_unused *t)
{
struct null_data *nd = (struct null_data *) td->io_ops->data;
int ret = 0;
#define SUSPEND_ENTRIES 8
static int fio_posixaio_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max, const struct timespec *t)
{
struct posixaio_data *pd = td->io_ops->data;
os_aiocb_t *suspend_list[SUSPEND_ENTRIES];
}
static int fio_rbd_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max, const struct timespec *t)
{
struct rbd_data *rbd_data = td->io_ops->data;
unsigned int events = 0;
}
static int fio_rdmaio_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max, const struct timespec *t)
{
struct rdmaio_data *rd = td->io_ops->data;
enum ibv_wc_opcode comp_opcode;
}
static int fio_sgio_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec fio_unused *t)
+ unsigned int max,
+ const struct timespec fio_unused *t)
{
struct sgio_data *sd = td->io_ops->data;
int left = max, ret, r = 0;
* numbers. Required.
*/
static int fio_skeleton_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max, const struct timespec *t)
{
return 0;
}
}
static int fio_solarisaio_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max, const struct timespec *t)
{
struct solarisaio_data *sd = td->io_ops->data;
struct timeval tv;
static int fio_vsyncio_getevents(struct thread_data *td, unsigned int min,
unsigned int max,
- struct timespec fio_unused *t)
+ const struct timespec fio_unused *t)
{
struct syncio_data *sd = td->io_ops->data;
int ret;
static BOOL timeout_expired(DWORD start_count, DWORD end_count);
static int fio_windowsaio_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t);
+ unsigned int max, const struct timespec *t);
static struct io_u *fio_windowsaio_event(struct thread_data *td, int event);
static int fio_windowsaio_queue(struct thread_data *td,
struct io_u *io_u);
}
static int fio_windowsaio_getevents(struct thread_data *td, unsigned int min,
- unsigned int max, struct timespec *t)
+ unsigned int max,
+ const struct timespec *t)
{
struct windowsaio_data *wd = td->io_ops->data;
unsigned int dequeued = 0;
#define FIO_TIME_H
struct thread_data;
-extern uint64_t utime_since(struct timeval *, struct timeval *);
-extern uint64_t utime_since_now(struct timeval *);
-extern uint64_t mtime_since(struct timeval *, struct timeval *);
-extern uint64_t mtime_since_now(struct timeval *);
-extern uint64_t time_since_now(struct timeval *);
+extern uint64_t utime_since(const struct timeval *,const struct timeval *);
+extern uint64_t utime_since_now(const struct timeval *);
+extern uint64_t mtime_since(const struct timeval *, const struct timeval *);
+extern uint64_t mtime_since_now(const struct timeval *);
+extern uint64_t time_since_now(const struct timeval *);
extern uint64_t mtime_since_genesis(void);
extern uint64_t utime_since_genesis(void);
extern void usec_spin(unsigned int);
log_info("fio: clocksource=cpu may not be reliable\n");
}
-uint64_t utime_since(struct timeval *s, struct timeval *e)
+uint64_t utime_since(const struct timeval *s, const struct timeval *e)
{
long sec, usec;
uint64_t ret;
return ret;
}
-uint64_t utime_since_now(struct timeval *s)
+uint64_t utime_since_now(const struct timeval *s)
{
struct timeval t;
return utime_since(s, &t);
}
-uint64_t mtime_since(struct timeval *s, struct timeval *e)
+uint64_t mtime_since(const struct timeval *s, const struct timeval *e)
{
long sec, usec, ret;
return ret;
}
-uint64_t mtime_since_now(struct timeval *s)
+uint64_t mtime_since_now(const struct timeval *s)
{
struct timeval t;
void *p = __builtin_return_address(0);
return mtime_since(s, &t);
}
-uint64_t time_since_now(struct timeval *s)
+uint64_t time_since_now(const struct timeval *s)
{
return mtime_since_now(s) / 1000;
}
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, struct timespec *);
+ int (*getevents)(struct thread_data *, unsigned int, unsigned int, const struct timespec *);
struct io_u *(*event)(struct thread_data *, int);
int (*cancel)(struct thread_data *, struct io_u *);
void (*cleanup)(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_sync(struct thread_data *, struct fio_file *);
-extern int __must_check td_io_getevents(struct thread_data *, unsigned int, unsigned int, struct timespec *);
+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 *);
}
int td_io_getevents(struct thread_data *td, unsigned int min, unsigned int max,
- struct timespec *t)
+ const struct timespec *t)
{
int r = 0;
td->total_io_size += ipo->len;
}
-void log_io_u(struct thread_data *td, struct io_u *io_u)
+void log_io_u(const struct thread_data *td, const struct io_u *io_u)
{
if (!td->o.write_iolog_file)
return;
td->io_hist_len--;
}
-void trim_io_piece(struct thread_data *td, struct io_u *io_u)
+void trim_io_piece(struct thread_data *td, const struct io_u *io_u)
{
struct io_piece *ipo = io_u->ipo;
struct io_u;
extern int __must_check read_iolog_get(struct thread_data *, struct io_u *);
-extern void log_io_u(struct thread_data *, struct io_u *);
+extern void log_io_u(const struct thread_data *, const struct io_u *);
extern void log_file(struct thread_data *, struct fio_file *, enum file_log_act);
extern int __must_check init_iolog(struct thread_data *td);
extern void log_io_piece(struct thread_data *, struct io_u *);
extern void unlog_io_piece(struct thread_data *, struct io_u *);
-extern void trim_io_piece(struct thread_data *, struct io_u *);
+extern void trim_io_piece(struct thread_data *, const struct io_u *);
extern void queue_io_piece(struct thread_data *, struct io_piece *);
extern void prune_io_piece_log(struct thread_data *);
extern void write_iolog_close(struct thread_data *);