summaryrefslogtreecommitdiff
path: root/libbcachefs/keylist.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2017-06-13 17:06:05 -0800
committerKent Overstreet <kent.overstreet@gmail.com>2017-06-13 17:41:59 -0800
commit38f22164a9a3f2f8e33af8e0cc3ce4f17ef99cde (patch)
tree3b5de0fc73f51199bea8fcb63ad97a5b01a7c4ca /libbcachefs/keylist.c
parent914c4d19ed4a1c64268c4c23609c43d3d6765969 (diff)
Update bcachefs sources to 6a25f7a00d bcachefs: fix ioctl code
Diffstat (limited to 'libbcachefs/keylist.c')
-rw-r--r--libbcachefs/keylist.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libbcachefs/keylist.c b/libbcachefs/keylist.c
index 51dd7edc..bc724e77 100644
--- a/libbcachefs/keylist.c
+++ b/libbcachefs/keylist.c
@@ -53,3 +53,14 @@ void bch2_keylist_pop_front(struct keylist *l)
bkey_next(l->keys),
bch_keylist_u64s(l));
}
+
+#ifdef CONFIG_BCACHEFS_DEBUG
+void bch2_verify_keylist_sorted(struct keylist *l)
+{
+ struct bkey_i *k;
+
+ for_each_keylist_key(l, k)
+ BUG_ON(bkey_next(k) != l->top &&
+ bkey_cmp(k->k.p, bkey_next(k)->k.p) >= 0);
+}
+#endif