Pass O_DIRECT/O_SYNC to glfs_open if requested.
[fio.git] / flist.h
diff --git a/flist.h b/flist.h
index 95023c75aa1799732ea8f2ea99e64c3df4027644..938ce1d8317378e18b5824128ac7c4b37f4ff893 100644 (file)
--- a/flist.h
+++ b/flist.h
@@ -1,6 +1,8 @@
 #ifndef _LINUX_FLIST_H
 #define _LINUX_FLIST_H
 
+#include <stdlib.h>
+
 #undef offsetof
 #ifdef __compiler_offsetof
 #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER)
@@ -138,6 +140,13 @@ static inline void flist_splice(const struct flist_head *list,
                __flist_splice(list, head, head->next);
 }
 
+static inline void flist_splice_tail(struct flist_head *list,
+                                    struct flist_head *head)
+{
+       if (!flist_empty(list))
+               __flist_splice(list, head->prev, head);
+}
+
 static inline void flist_splice_init(struct flist_head *list,
                                    struct flist_head *head)
 {
@@ -174,4 +183,7 @@ static inline void flist_splice_init(struct flist_head *list,
        for (pos = (head)->next, n = pos->next; pos != (head); \
                pos = n, n = pos->next)
 
+extern void flist_sort(void *priv, struct flist_head *head,
+       int (*cmp)(void *priv, struct flist_head *a, struct flist_head *b));
+
 #endif