-/*
- * Disk utils as read in /sys/block/<dev>/stat
- */
-struct disk_util_stat {
- unsigned ios[2];
- unsigned merges[2];
- unsigned long long sectors[2];
- unsigned ticks[2];
- unsigned io_ticks;
- unsigned time_in_queue;
-};
-
-/*
- * Per-device disk util management
- */
-struct disk_util {
- struct flist_head list;
- /* If this disk is a slave, hook it into the master's
- * list using this head.
- */
- struct flist_head slavelist;
-
- char *name;
- char *sysfs_root;
- char path[256];
- int major, minor;
-
- struct disk_util_stat dus;
- struct disk_util_stat last_dus;
-
- /* For software raids, this entry maintains pointers to the
- * entries for the slave devices. The disk_util entries for
- * the slaves devices should primarily be maintained through
- * the disk_list list, i.e. for memory allocation and
- * de-allocation, etc. Whereas this list should be used only
- * for aggregating a software RAID's disk util figures.
- */
- struct flist_head slaves;
-
- unsigned long msec;
- struct timeval time;
-
- struct fio_mutex *lock;
- unsigned long users;
-};
-
-static inline void disk_util_inc(struct disk_util *du)
-{
- if (du) {
- fio_mutex_down(du->lock);
- du->users++;
- fio_mutex_up(du->lock);
- }
-}
-
-static inline void disk_util_dec(struct disk_util *du)
-{
- if (du) {
- fio_mutex_down(du->lock);
- du->users--;
- fio_mutex_up(du->lock);
- }
-}
-
-#define DISK_UTIL_MSEC (250)
-
-/*
- * Time functions
- */
-extern unsigned long long utime_since(struct timeval *, struct timeval *);
-extern unsigned long long utime_since_now(struct timeval *);
-extern unsigned long mtime_since(struct timeval *, struct timeval *);
-extern unsigned long mtime_since_now(struct timeval *);
-extern unsigned long time_since_now(struct timeval *);
-extern unsigned long mtime_since_genesis(void);
-extern void usec_spin(unsigned int);
-extern void usec_sleep(struct thread_data *, unsigned long);
-extern void rate_throttle(struct thread_data *, unsigned long, unsigned int);
-extern void fill_start_time(struct timeval *);
-extern void fio_gettime(struct timeval *, void *);
-extern void fio_gtod_init(void);
-extern void fio_gtod_update(void);
-extern void set_genesis_time(void);
-extern int ramp_time_over(struct thread_data *);
-extern int in_ramp_time(struct thread_data *);
-