X-Git-Url: https://git.kernel.dk/?a=blobdiff_plain;f=flist.h;h=938ce1d8317378e18b5824128ac7c4b37f4ff893;hb=65bea10ffcd2a8220c65d644933d546a8a7de78d;hp=95023c75aa1799732ea8f2ea99e64c3df4027644;hpb=e53ab27c7425241d64e8d64ad77850a776c01375;p=fio.git diff --git a/flist.h b/flist.h index 95023c75..938ce1d8 100644 --- a/flist.h +++ b/flist.h @@ -1,6 +1,8 @@ #ifndef _LINUX_FLIST_H #define _LINUX_FLIST_H +#include + #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