summaryrefslogtreecommitdiff
path: root/list_sort.h
diff options
context:
space:
mode:
authorDavid Sterba <dsterba@suse.cz>2013-09-17 17:24:53 +0200
committerChris Mason <chris.mason@fusionio.com>2013-10-16 08:22:26 -0400
commit4e466c8b440afd09a8bf600bcf18469c3e7539cd (patch)
tree9f7f063ae99962568becb47fc56f360a2226e6e8 /list_sort.h
parente9270f62090c2312bccb340e4394bc216733edac (diff)
btrfs-progs: add list_sort and use it to sort devices by id
The devices in 'btrfs filesystem show' are now sorted by the device id, currently the order was undefined. Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
Diffstat (limited to 'list_sort.h')
-rw-r--r--list_sort.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/list_sort.h b/list_sort.h
new file mode 100644
index 00000000..987cd5c4
--- /dev/null
+++ b/list_sort.h
@@ -0,0 +1,14 @@
+/*
+ * taken from linux kernel include/list_sort.h
+ */
+#ifndef _LINUX_LIST_SORT_H
+#define _LINUX_LIST_SORT_H
+
+#include "kerncompat.h"
+
+struct list_head;
+
+void list_sort(void *priv, struct list_head *head,
+ int (*cmp)(void *priv, struct list_head *a,
+ struct list_head *b));
+#endif