]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/keylist.c
New upstream release
[bcachefs-tools-debian] / libbcachefs / keylist.c
index 5e85055b0f9382df6ef9ababd31975c16f50cd98..5699cd4873c81d3c393aa59f339c328b051f90b8 100644 (file)
@@ -18,7 +18,7 @@ int bch2_keylist_realloc(struct keylist *l, u64 *inline_u64s,
            (old_buf && roundup_pow_of_two(oldsize) == newsize))
                return 0;
 
-       new_keys = krealloc(old_buf, sizeof(u64) * newsize, GFP_NOIO);
+       new_keys = krealloc(old_buf, sizeof(u64) * newsize, GFP_NOFS);
        if (!new_keys)
                return -ENOMEM;
 
@@ -31,22 +31,6 @@ int bch2_keylist_realloc(struct keylist *l, u64 *inline_u64s,
        return 0;
 }
 
-void bch2_keylist_add_in_order(struct keylist *l, struct bkey_i *insert)
-{
-       struct bkey_i *where;
-
-       for_each_keylist_key(l, where)
-               if (bkey_cmp(insert->k.p, where->k.p) < 0)
-                       break;
-
-       memmove_u64s_up((u64 *) where + insert->k.u64s,
-                       where,
-                       ((u64 *) l->top) - ((u64 *) where));
-
-       l->top_p += insert->k.u64s;
-       bkey_copy(where, insert);
-}
-
 void bch2_keylist_pop_front(struct keylist *l)
 {
        l->top_p -= bch2_keylist_front(l)->k.u64s;
@@ -63,6 +47,6 @@ void bch2_verify_keylist_sorted(struct keylist *l)
 
        for_each_keylist_key(l, k)
                BUG_ON(bkey_next(k) != l->top &&
-                      bpos_cmp(k->k.p, bkey_next(k)->k.p) >= 0);
+                      bpos_ge(k->k.p, bkey_next(k)->k.p));
 }
 #endif