#include <sys/stat.h>
#include <dirent.h>
-#include "list.h"
+#include "flist.h"
#include "fio.h"
#include "blktrace_api.h"
ipo->ddir = DDIR_INVAL;
ipo->fileno = fileno;
ipo->file_action = FIO_LOG_OPEN_FILE;
- list_add_tail(&ipo->list, &td->io_log_list);
+ flist_add_tail(&ipo->list, &td->io_log_list);
}
static void trace_add_file(struct thread_data *td, __u32 device)
struct io_piece *ipo = malloc(sizeof(*ipo));
memset(ipo, 0, sizeof(*ipo));
- INIT_LIST_HEAD(&ipo->list);
+ INIT_FLIST_HEAD(&ipo->list);
/*
* the 512 is wrong here, it should be the hardware sector size...
*/
static int last_majdev, last_mindev;
-static struct list_head disk_list = LIST_HEAD_INIT(disk_list);
+static struct flist_head disk_list = FLIST_HEAD_INIT(disk_list);
static int get_io_ticks(struct disk_util *du, struct disk_util_stat *dus)
{
void update_io_ticks(void)
{
- struct list_head *entry;
+ struct flist_head *entry;
struct disk_util *du;
dprint(FD_DISKUTIL, "update io ticks\n");
- list_for_each(entry, &disk_list) {
- du = list_entry(entry, struct disk_util, list);
+ flist_for_each(entry, &disk_list) {
+ du = flist_entry(entry, struct disk_util, list);
update_io_tick_disk(du);
}
}
static struct disk_util *disk_util_exists(int major, int minor)
{
- struct list_head *entry;
+ struct flist_head *entry;
struct disk_util *du;
- list_for_each(entry, &disk_list) {
- du = list_entry(entry, struct disk_util, list);
+ flist_for_each(entry, &disk_list) {
+ du = flist_entry(entry, struct disk_util, list);
if (major == du->major && minor == du->minor)
return du;
static void disk_util_add(int majdev, int mindev, char *path)
{
struct disk_util *du, *__du;
- struct list_head *entry;
+ struct flist_head *entry;
dprint(FD_DISKUTIL, "add maj/min %d/%d: %s\n", majdev, mindev, path);
du = malloc(sizeof(*du));
memset(du, 0, sizeof(*du));
- INIT_LIST_HEAD(&du->list);
+ INIT_FLIST_HEAD(&du->list);
sprintf(du->path, "%s/stat", path);
du->name = strdup(basename(path));
du->sysfs_root = path;
du->major = majdev;
du->minor = mindev;
- list_for_each(entry, &disk_list) {
- __du = list_entry(entry, struct disk_util, list);
+ flist_for_each(entry, &disk_list) {
+ __du = flist_entry(entry, struct disk_util, list);
dprint(FD_DISKUTIL, "found %s in list\n", __du->name);
fio_gettime(&du->time, NULL);
get_io_ticks(du, &du->last_dus);
- list_add_tail(&du->list, &disk_list);
+ flist_add_tail(&du->list, &disk_list);
}
static int check_dev_match(int majdev, int mindev, char *path)
void show_disk_util(void)
{
struct disk_util_stat *dus;
- struct list_head *entry, *next;
+ struct flist_head *entry, *next;
struct disk_util *du;
double util;
- if (list_empty(&disk_list))
+ if (flist_empty(&disk_list))
return;
log_info("\nDisk stats (read/write):\n");
- list_for_each(entry, &disk_list) {
- du = list_entry(entry, struct disk_util, list);
+ flist_for_each(entry, &disk_list) {
+ du = flist_entry(entry, struct disk_util, list);
dus = &du->dus;
util = (double) 100 * du->dus.io_ticks / (double) du->msec;
/*
* now free the list
*/
- list_for_each_safe(entry, next, &disk_list) {
- list_del(entry);
- du = list_entry(entry, struct disk_util, list);
+ flist_for_each_safe(entry, next, &disk_list) {
+ flist_del(entry);
+ du = flist_entry(entry, struct disk_util, list);
free(du->name);
free(du);
}
{
struct posixaio_data *pd = td->io_ops->data;
struct aiocb *suspend_list[SUSPEND_ENTRIES];
- struct list_head *entry;
+ struct flist_head *entry;
struct timespec start;
int have_timeout = 0;
int suspend_entries = 0;
r = 0;
memset(suspend_list, 0, sizeof(*suspend_list));
restart:
- list_for_each(entry, &td->io_u_busylist) {
- struct io_u *io_u = list_entry(entry, struct io_u, list);
+ flist_for_each(entry, &td->io_u_busylist) {
+ struct io_u *io_u = flist_entry(entry, struct io_u, list);
int err;
if (io_u->seen)
#include <assert.h>
#include "fio.h"
-#include "list.h"
+#include "flist.h"
#include "crc/crc16.h"
#define HASH_BUCKETS 512
#define HASH_MASK (HASH_BUCKETS - 1)
-unsigned int file_hash_size = HASH_BUCKETS * sizeof(struct list_head);
+unsigned int file_hash_size = HASH_BUCKETS * sizeof(struct flist_head);
-static struct list_head *file_hash;
+static struct flist_head *file_hash;
static struct fio_mutex *hash_lock;
static unsigned short hash(const char *name)
fio_mutex_down(hash_lock);
if (f->flags & FIO_FILE_HASHED) {
- assert(!list_empty(&f->hash_list));
- list_del_init(&f->hash_list);
+ assert(!flist_empty(&f->hash_list));
+ flist_del_init(&f->hash_list);
f->flags &= ~FIO_FILE_HASHED;
}
static struct fio_file *__lookup_file_hash(const char *name)
{
- struct list_head *bucket = &file_hash[hash(name)];
- struct list_head *n;
+ struct flist_head *bucket = &file_hash[hash(name)];
+ struct flist_head *n;
- list_for_each(n, bucket) {
- struct fio_file *f = list_entry(n, struct fio_file, hash_list);
+ flist_for_each(n, bucket) {
+ struct fio_file *f = flist_entry(n, struct fio_file, hash_list);
if (!strcmp(f->file_name, name)) {
assert(f->fd != -1);
if (f->flags & FIO_FILE_HASHED)
return NULL;
- INIT_LIST_HEAD(&f->hash_list);
+ INIT_FLIST_HEAD(&f->hash_list);
fio_mutex_down(hash_lock);
alias = __lookup_file_hash(f->file_name);
if (!alias) {
f->flags |= FIO_FILE_HASHED;
- list_add_tail(&f->hash_list, &file_hash[hash(f->file_name)]);
+ flist_add_tail(&f->hash_list, &file_hash[hash(f->file_name)]);
}
fio_mutex_up(hash_lock);
fio_mutex_down(hash_lock);
for (i = 0; i < HASH_BUCKETS; i++)
- has_entries += !list_empty(&file_hash[i]);
+ has_entries += !flist_empty(&file_hash[i]);
fio_mutex_up(hash_lock);
if (has_entries)
file_hash = ptr;
for (i = 0; i < HASH_BUCKETS; i++)
- INIT_LIST_HEAD(&file_hash[i]);
+ INIT_FLIST_HEAD(&file_hash[i]);
hash_lock = fio_mutex_init(1);
}
*/
static void cleanup_pending_aio(struct thread_data *td)
{
- struct list_head *entry, *n;
+ struct flist_head *entry, *n;
struct io_u *io_u;
int r;
* now cancel remaining active events
*/
if (td->io_ops->cancel) {
- list_for_each_safe(entry, n, &td->io_u_busylist) {
- io_u = list_entry(entry, struct io_u, list);
+ flist_for_each_safe(entry, n, &td->io_u_busylist) {
+ io_u = flist_entry(entry, struct io_u, list);
/*
* if the io_u isn't in flight, then that generally
static void cleanup_io_u(struct thread_data *td)
{
- struct list_head *entry, *n;
+ struct flist_head *entry, *n;
struct io_u *io_u;
- list_for_each_safe(entry, n, &td->io_u_freelist) {
- io_u = list_entry(entry, struct io_u, list);
+ flist_for_each_safe(entry, n, &td->io_u_freelist) {
+ io_u = flist_entry(entry, struct io_u, list);
- list_del(&io_u->list);
+ flist_del(&io_u->list);
free(io_u);
}
return 1;
io_u = malloc(sizeof(*io_u));
memset(io_u, 0, sizeof(*io_u));
- INIT_LIST_HEAD(&io_u->list);
+ INIT_FLIST_HEAD(&io_u->list);
if (!(td->io_ops->flags & FIO_NOIO)) {
io_u->buf = p + max_bs * i;
io_u->index = i;
io_u->flags = IO_U_F_FREE;
- list_add(&io_u->list, &td->io_u_freelist);
+ flist_add(&io_u->list, &td->io_u_freelist);
}
io_u_init_timeout();
dprint(FD_PROCESS, "jobs pid=%d started\n", (int) td->pid);
- INIT_LIST_HEAD(&td->io_u_freelist);
- INIT_LIST_HEAD(&td->io_u_busylist);
- INIT_LIST_HEAD(&td->io_u_requeues);
- INIT_LIST_HEAD(&td->io_log_list);
- INIT_LIST_HEAD(&td->io_hist_list);
+ INIT_FLIST_HEAD(&td->io_u_freelist);
+ INIT_FLIST_HEAD(&td->io_u_busylist);
+ INIT_FLIST_HEAD(&td->io_u_requeues);
+ INIT_FLIST_HEAD(&td->io_log_list);
+ INIT_FLIST_HEAD(&td->io_hist_list);
td->io_hist_tree = RB_ROOT;
td_set_runstate(td, TD_INITIALIZED);
#include <assert.h>
#include "compiler/compiler.h"
-#include "list.h"
+#include "flist.h"
#include "fifo.h"
#include "rbtree.h"
#include "arch/arch.h"
struct io_piece {
union {
struct rb_node rb_node;
- struct list_head list;
+ struct flist_head list;
};
union {
int fileno;
struct fio_file *file;
- struct list_head list;
+ struct flist_head list;
/*
* Callback for io completion
* this structure holds state information for a single file.
*/
struct fio_file {
- struct list_head hash_list;
+ struct flist_head hash_list;
enum fio_filetype filetype;
/*
*/
unsigned int cur_depth;
unsigned int io_u_queued;
- struct list_head io_u_freelist;
- struct list_head io_u_busylist;
- struct list_head io_u_requeues;
+ struct flist_head io_u_freelist;
+ struct flist_head io_u_busylist;
+ struct flist_head io_u_requeues;
/*
* Rate state
* if we are overwriting. Otherwise just use a fifo.
*/
struct rb_root io_hist_tree;
- struct list_head io_hist_list;
+ struct flist_head io_hist_list;
/*
* For IO replaying
*/
- struct list_head io_log_list;
+ struct flist_head io_log_list;
/*
* timeout handling
* Per-device disk util management
*/
struct disk_util {
- struct list_head list;
+ struct flist_head list;
char *name;
char *sysfs_root;
/*
* io unit handling
*/
-#define queue_full(td) list_empty(&(td)->io_u_freelist)
+#define queue_full(td) flist_empty(&(td)->io_u_freelist)
extern struct io_u *__get_io_u(struct thread_data *);
extern struct io_u *get_io_u(struct thread_data *);
extern void put_io_u(struct thread_data *, struct io_u *);
#endif
struct ioengine_ops {
- struct list_head list;
+ struct flist_head list;
char name[16];
int version;
int flags;
--- /dev/null
+#ifndef _LINUX_FLIST_H
+#define _LINUX_FLIST_H
+
+#undef offsetof
+#ifdef __compiler_offsetof
+#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
+#else
+#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
+#endif
+
+#define container_of(ptr, type, member) ({ \
+ const typeof( ((type *)0)->member ) *__mptr = (ptr); \
+ (type *)( (char *)__mptr - offsetof(type,member) );})
+
+/*
+ * Simple doubly linked list implementation.
+ *
+ * Some of the internal functions ("__xxx") are useful when
+ * manipulating whole lists rather than single entries, as
+ * sometimes we already know the next/prev entries and we can
+ * generate better code by using them directly rather than
+ * using the generic single-entry routines.
+ */
+
+struct flist_head {
+ struct flist_head *next, *prev;
+};
+
+#define FLIST_HEAD_INIT(name) { &(name), &(name) }
+
+#define FLIST_HEAD(name) \
+ struct flist_head name = FLIST_HEAD_INIT(name)
+
+#define INIT_FLIST_HEAD(ptr) do { \
+ (ptr)->next = (ptr); (ptr)->prev = (ptr); \
+} while (0)
+
+/*
+ * Insert a new entry between two known consecutive entries.
+ *
+ * This is only for internal list manipulation where we know
+ * the prev/next entries already!
+ */
+static inline void __flist_add(struct flist_head *new,
+ struct flist_head *prev,
+ struct flist_head *next)
+{
+ next->prev = new;
+ new->next = next;
+ new->prev = prev;
+ prev->next = new;
+}
+
+/**
+ * flist_add - add a new entry
+ * @new: new entry to be added
+ * @head: list head to add it after
+ *
+ * Insert a new entry after the specified head.
+ * This is good for implementing stacks.
+ */
+static inline void flist_add(struct flist_head *new, struct flist_head *head)
+{
+ __flist_add(new, head, head->next);
+}
+
+static inline void flist_add_tail(struct flist_head *new,
+ struct flist_head *head)
+{
+ __flist_add(new, head->prev, head);
+}
+
+/*
+ * Delete a list entry by making the prev/next entries
+ * point to each other.
+ *
+ * This is only for internal list manipulation where we know
+ * the prev/next entries already!
+ */
+static inline void __flist_del(struct flist_head *prev,
+ struct flist_head * next)
+{
+ next->prev = prev;
+ prev->next = next;
+}
+
+/**
+ * flist_del - deletes entry from list.
+ * @entry: the element to delete from the list.
+ * Note: flist_empty on entry does not return true after this, the entry is
+ * in an undefined state.
+ */
+static inline void flist_del(struct flist_head *entry)
+{
+ __flist_del(entry->prev, entry->next);
+ entry->next = NULL;
+ entry->prev = NULL;
+}
+
+/**
+ * flist_del_init - deletes entry from list and reinitialize it.
+ * @entry: the element to delete from the list.
+ */
+static inline void flist_del_init(struct flist_head *entry)
+{
+ __flist_del(entry->prev, entry->next);
+ INIT_FLIST_HEAD(entry);
+}
+
+/**
+ * flist_empty - tests whether a list is empty
+ * @head: the list to test.
+ */
+static inline int flist_empty(const struct flist_head *head)
+{
+ return head->next == head;
+}
+
+/**
+ * flist_entry - get the struct for this entry
+ * @ptr: the &struct flist_head pointer.
+ * @type: the type of the struct this is embedded in.
+ * @member: the name of the flist_struct within the struct.
+ */
+#define flist_entry(ptr, type, member) \
+ container_of(ptr, type, member)
+
+/**
+ * flist_for_each - iterate over a list
+ * @pos: the &struct flist_head to use as a loop counter.
+ * @head: the head for your list.
+ */
+#define flist_for_each(pos, head) \
+ for (pos = (head)->next; pos != (head); pos = pos->next)
+
+/**
+ * flist_for_each_safe - iterate over a list safe against removal of list entry
+ * @pos: the &struct flist_head to use as a loop counter.
+ * @n: another &struct flist_head to use as temporary storage
+ * @head: the head for your list.
+ */
+#define flist_for_each_safe(pos, n, head) \
+ for (pos = (head)->next, n = pos->next; pos != (head); \
+ pos = n, n = pos->next)
+
+#endif
#define HASH_BITS 8
#define HASH_SIZE (1 << HASH_BITS)
-static struct list_head hash[HASH_SIZE];
+static struct flist_head hash[HASH_SIZE];
static int gtod_inited;
struct gtod_log {
- struct list_head list;
+ struct flist_head list;
void *caller;
unsigned long calls;
};
static struct gtod_log *find_hash(void *caller)
{
unsigned long h = hash_ptr(caller, HASH_BITS);
- struct list_head *entry;
+ struct flist_head *entry;
- list_for_each(entry, &hash[h]) {
- struct gtod_log *log = list_entry(entry, struct gtod_log, list);
+ flist_for_each(entry, &hash[h]) {
+ struct gtod_log *log = flist_entry(entry, struct gtod_log,
+ list);
if (log->caller == caller)
return log;
unsigned long h;
log = malloc(sizeof(*log));
- INIT_LIST_HEAD(&log->list);
+ INIT_FLIST_HEAD(&log->list);
log->caller = caller;
log->calls = 0;
h = hash_ptr(caller, HASH_BITS);
- list_add_tail(&log->list, &hash[h]);
+ flist_add_tail(&log->list, &hash[h]);
}
return log;
int i;
for (i = 0; i < HASH_SIZE; i++) {
- struct list_head *entry;
+ struct flist_head *entry;
struct gtod_log *log;
- list_for_each(entry, &hash[i]) {
- log = list_entry(entry, struct gtod_log, list);
+ flist_for_each(entry, &hash[i]) {
+ log = flist_entry(entry, struct gtod_log, list);
printf("function %p, calls %lu\n", log->caller,
log->calls);
int i;
for (i = 0; i < HASH_SIZE; i++)
- INIT_LIST_HEAD(&hash[i]);
+ INIT_FLIST_HEAD(&hash[i]);
gtod_inited = 1;
}
put_file_log(td, io_u->file);
io_u->file = NULL;
- list_del(&io_u->list);
- list_add(&io_u->list, &td->io_u_freelist);
+ flist_del(&io_u->list);
+ flist_add(&io_u->list, &td->io_u_freelist);
td->cur_depth--;
}
__io_u->flags &= ~IO_U_F_FLIGHT;
- list_del(&__io_u->list);
- list_add_tail(&__io_u->list, &td->io_u_requeues);
+ flist_del(&__io_u->list);
+ flist_add_tail(&__io_u->list, &td->io_u_requeues);
td->cur_depth--;
*io_u = NULL;
}
{
struct io_u *io_u = NULL;
- if (!list_empty(&td->io_u_requeues))
- io_u = list_entry(td->io_u_requeues.next, struct io_u, list);
+ if (!flist_empty(&td->io_u_requeues))
+ io_u = flist_entry(td->io_u_requeues.next, struct io_u, list);
else if (!queue_full(td)) {
- io_u = list_entry(td->io_u_freelist.next, struct io_u, list);
+ io_u = flist_entry(td->io_u_freelist.next, struct io_u, list);
io_u->buflen = 0;
io_u->resid = 0;
io_u->flags &= ~IO_U_F_FREE;
io_u->error = 0;
- list_del(&io_u->list);
- list_add(&io_u->list, &td->io_u_busylist);
+ flist_del(&io_u->list);
+ flist_add(&io_u->list, &td->io_u_busylist);
td->cur_depth++;
}
{
struct thread_data *td, *__td;
pid_t pid = getpid();
- struct list_head *entry;
+ struct flist_head *entry;
struct io_u *io_u;
int i;
log_err("fio: io_u timeout: job=%s, pid=%d\n", td->o.name, td->pid);
- list_for_each(entry, &td->io_u_busylist) {
- io_u = list_entry(entry, struct io_u, list);
+ flist_for_each(entry, &td->io_u_busylist) {
+ io_u = flist_entry(entry, struct io_u, list);
io_u_dump(io_u);
}
#include "fio.h"
-static LIST_HEAD(engine_list);
+static FLIST_HEAD(engine_list);
static int check_engine_ops(struct ioengine_ops *ops)
{
void unregister_ioengine(struct ioengine_ops *ops)
{
dprint(FD_IO, "ioengine %s unregistered\n", ops->name);
- list_del(&ops->list);
- INIT_LIST_HEAD(&ops->list);
+ flist_del(&ops->list);
+ INIT_FLIST_HEAD(&ops->list);
}
void register_ioengine(struct ioengine_ops *ops)
{
dprint(FD_IO, "ioengine %s registered\n", ops->name);
- INIT_LIST_HEAD(&ops->list);
- list_add_tail(&ops->list, &engine_list);
+ INIT_FLIST_HEAD(&ops->list);
+ flist_add_tail(&ops->list, &engine_list);
}
static struct ioengine_ops *find_ioengine(const char *name)
{
struct ioengine_ops *ops;
- struct list_head *entry;
+ struct flist_head *entry;
- list_for_each(entry, &engine_list) {
- ops = list_entry(entry, struct ioengine_ops, list);
+ flist_for_each(entry, &engine_list) {
+ ops = flist_entry(entry, struct ioengine_ops, list);
if (!strcmp(name, ops->name))
return ops;
}
+++ /dev/null
-#ifndef _LINUX_LIST_H
-#define _LINUX_LIST_H
-
-#undef offsetof
-#ifdef __compiler_offsetof
-#define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
-#else
-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER)
-#endif
-
-#define container_of(ptr, type, member) ({ \
- const typeof( ((type *)0)->member ) *__mptr = (ptr); \
- (type *)( (char *)__mptr - offsetof(type,member) );})
-
-/*
- * Simple doubly linked list implementation.
- *
- * Some of the internal functions ("__xxx") are useful when
- * manipulating whole lists rather than single entries, as
- * sometimes we already know the next/prev entries and we can
- * generate better code by using them directly rather than
- * using the generic single-entry routines.
- */
-
-struct list_head {
- struct list_head *next, *prev;
-};
-
-#define LIST_HEAD_INIT(name) { &(name), &(name) }
-
-#define LIST_HEAD(name) \
- struct list_head name = LIST_HEAD_INIT(name)
-
-#define INIT_LIST_HEAD(ptr) do { \
- (ptr)->next = (ptr); (ptr)->prev = (ptr); \
-} while (0)
-
-/*
- * Insert a new entry between two known consecutive entries.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static inline void __list_add(struct list_head *new,
- struct list_head *prev,
- struct list_head *next)
-{
- next->prev = new;
- new->next = next;
- new->prev = prev;
- prev->next = new;
-}
-
-/**
- * list_add - add a new entry
- * @new: new entry to be added
- * @head: list head to add it after
- *
- * Insert a new entry after the specified head.
- * This is good for implementing stacks.
- */
-static inline void list_add(struct list_head *new, struct list_head *head)
-{
- __list_add(new, head, head->next);
-}
-
-static inline void list_add_tail(struct list_head *new, struct list_head *head)
-{
- __list_add(new, head->prev, head);
-}
-
-/*
- * Delete a list entry by making the prev/next entries
- * point to each other.
- *
- * This is only for internal list manipulation where we know
- * the prev/next entries already!
- */
-static inline void __list_del(struct list_head * prev, struct list_head * next)
-{
- next->prev = prev;
- prev->next = next;
-}
-
-/**
- * list_del - deletes entry from list.
- * @entry: the element to delete from the list.
- * Note: list_empty on entry does not return true after this, the entry is
- * in an undefined state.
- */
-static inline void list_del(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
- entry->next = NULL;
- entry->prev = NULL;
-}
-
-/**
- * list_del_init - deletes entry from list and reinitialize it.
- * @entry: the element to delete from the list.
- */
-static inline void list_del_init(struct list_head *entry)
-{
- __list_del(entry->prev, entry->next);
- INIT_LIST_HEAD(entry);
-}
-
-/**
- * list_empty - tests whether a list is empty
- * @head: the list to test.
- */
-static inline int list_empty(const struct list_head *head)
-{
- return head->next == head;
-}
-
-/**
- * list_entry - get the struct for this entry
- * @ptr: the &struct list_head pointer.
- * @type: the type of the struct this is embedded in.
- * @member: the name of the list_struct within the struct.
- */
-#define list_entry(ptr, type, member) \
- container_of(ptr, type, member)
-
-/**
- * list_for_each - iterate over a list
- * @pos: the &struct list_head to use as a loop counter.
- * @head: the head for your list.
- */
-#define list_for_each(pos, head) \
- for (pos = (head)->next; pos != (head); pos = pos->next)
-
-/**
- * list_for_each_safe - iterate over a list safe against removal of list entry
- * @pos: the &struct list_head to use as a loop counter.
- * @n: another &struct list_head to use as temporary storage
- * @head: the head for your list.
- */
-#define list_for_each_safe(pos, n, head) \
- for (pos = (head)->next, n = pos->next; pos != (head); \
- pos = n, n = pos->next)
-
-#endif
#include <stdlib.h>
#include <libgen.h>
#include <assert.h>
-#include "list.h"
+#include "flist.h"
#include "fio.h"
static const char iolog_ver2[] = "fio version 2 iolog";
void queue_io_piece(struct thread_data *td, struct io_piece *ipo)
{
- list_add_tail(&ipo->list, &td->io_log_list);
+ flist_add_tail(&ipo->list, &td->io_log_list);
td->total_io_size += ipo->len;
}
{
struct io_piece *ipo;
- while (!list_empty(&td->io_log_list)) {
+ while (!flist_empty(&td->io_log_list)) {
int ret;
- ipo = list_entry(td->io_log_list.next, struct io_piece, list);
- list_del(&ipo->list);
+ ipo = flist_entry(td->io_log_list.next, struct io_piece, list);
+ flist_del(&ipo->list);
ret = ipo_special(td, ipo);
if (ret < 0) {
free(ipo);
}
- while (!list_empty(&td->io_hist_list)) {
- ipo = list_entry(td->io_hist_list.next, struct io_piece, list);
- list_del(&ipo->list);
+ while (!flist_empty(&td->io_hist_list)) {
+ ipo = flist_entry(td->io_hist_list.next, struct io_piece, list);
+ flist_del(&ipo->list);
free(ipo);
}
}
* wrote it out is the fastest.
*/
if (!td_random(td) || !td->o.overwrite) {
- INIT_LIST_HEAD(&ipo->list);
- list_add_tail(&ipo->list, &td->io_hist_list);
+ INIT_FLIST_HEAD(&ipo->list);
+ flist_add_tail(&ipo->list, &td->io_hist_list);
return;
}
*/
ipo = malloc(sizeof(*ipo));
memset(ipo, 0, sizeof(*ipo));
- INIT_LIST_HEAD(&ipo->list);
+ INIT_FLIST_HEAD(&ipo->list);
ipo->offset = offset;
ipo->len = bytes;
ipo->ddir = rw;
ipo = rb_entry(n, struct io_piece, rb_node);
rb_erase(n, &td->io_hist_tree);
- } else if (!list_empty(&td->io_hist_list)) {
- ipo = list_entry(td->io_hist_list.next, struct io_piece, list);
- list_del(&ipo->list);
+ } else if (!flist_empty(&td->io_hist_list)) {
+ ipo = flist_entry(td->io_hist_list.next, struct io_piece, list);
+ flist_del(&ipo->list);
}
if (ipo) {