};
#endif
+enum {
+ IO_U_F_FREE = 1 << 0,
+ IO_U_F_FLIGHT = 1 << 1,
+};
+
/*
* The io unit
*/
unsigned int seen;
};
+ unsigned int flags;
+
struct fio_file *file;
struct list_head list;
*/
struct list_head io_hist_list;
struct list_head io_log_list;
+
+ /*
+ * timeout handling
+ */
+ struct timeval timeout_end;
+ struct itimerval timer;
};
+/*
+ * 30 second per-io_u timeout, with 5 second intervals to avoid resetting
+ * the timer on each queue operation.
+ */
+#define IO_U_TIMEOUT_INC 5
+#define IO_U_TIMEOUT 30
+
#define __td_verror(td, err, msg) \
do { \
+ if ((td)->error) \
+ break; \
int e = (err); \
(td)->error = e; \
snprintf(td->verror, sizeof(td->verror) - 1, "file:%s:%d, error=%s", __FILE__, __LINE__, (msg)); \
/*
* Log exports
*/
-extern int read_iolog_get(struct thread_data *, struct io_u *);
+extern int __must_check read_iolog_get(struct thread_data *, struct io_u *);
extern void write_iolog_put(struct thread_data *, struct io_u *);
-extern int init_iolog(struct thread_data *td);
+extern int __must_check init_iolog(struct thread_data *td);
extern void log_io_piece(struct thread_data *, struct io_u *);
extern void prune_io_piece_log(struct thread_data *);
extern void write_iolog_close(struct thread_data *);
extern void rate_throttle(struct thread_data *, unsigned long, unsigned int, int);
extern void fill_start_time(struct timeval *);
extern void fio_gettime(struct timeval *, void *);
+extern void set_genesis_time(void);
/*
* Init functions
*/
-extern int parse_options(int, char **);
-extern int init_random_state(struct thread_data *);
+extern int __must_check parse_options(int, char **);
+extern int __must_check init_random_state(struct thread_data *);
/*
* File setup/shutdown
extern long __must_check io_u_sync_complete(struct thread_data *, struct io_u *, endio_handler *);
extern long __must_check io_u_queued_complete(struct thread_data *, int, endio_handler *);
extern void io_u_queued(struct thread_data *, struct io_u *);
+extern void io_u_init_timeout(void);
+extern void io_u_set_timeout(struct thread_data *);
/*
* io engine entry points