]> git.sesse.net Git - bcachefs-tools-debian/blobdiff - libbcachefs/alloc_background.c
Update bcachefs sources to b12d1535f3 bcachefs: fix bounds checks in bch2_bio_map()
[bcachefs-tools-debian] / libbcachefs / alloc_background.c
index 7ba20c87caada672c25fdd91ce85c48ce9d23503..c3efb4357cad110833c9c2350faac615707c6a72 100644 (file)
@@ -582,7 +582,8 @@ static void find_reclaimable_buckets_lru(struct bch_fs *c, struct bch_dev *ca)
                        e.nr++;
                } else {
                        if (e.nr)
-                               heap_add_or_replace(&ca->alloc_heap, e, -bucket_alloc_cmp);
+                               heap_add_or_replace(&ca->alloc_heap, e,
+                                       -bucket_alloc_cmp, NULL);
 
                        e = (struct alloc_heap_entry) {
                                .bucket = b,
@@ -595,14 +596,15 @@ static void find_reclaimable_buckets_lru(struct bch_fs *c, struct bch_dev *ca)
        }
 
        if (e.nr)
-               heap_add_or_replace(&ca->alloc_heap, e, -bucket_alloc_cmp);
+               heap_add_or_replace(&ca->alloc_heap, e,
+                               -bucket_alloc_cmp, NULL);
 
        for (i = 0; i < ca->alloc_heap.used; i++)
                nr += ca->alloc_heap.data[i].nr;
 
        while (nr - ca->alloc_heap.data[0].nr >= ALLOC_SCAN_BATCH(ca)) {
                nr -= ca->alloc_heap.data[0].nr;
-               heap_pop(&ca->alloc_heap, e, -bucket_alloc_cmp);
+               heap_pop(&ca->alloc_heap, e, -bucket_alloc_cmp, NULL);
        }
 
        up_read(&ca->bucket_lock);
@@ -632,7 +634,7 @@ static void find_reclaimable_buckets_fifo(struct bch_fs *c, struct bch_dev *ca)
                if (bch2_can_invalidate_bucket(ca, b, m)) {
                        struct alloc_heap_entry e = { .bucket = b, .nr = 1, };
 
-                       heap_add(&ca->alloc_heap, e, bucket_alloc_cmp);
+                       heap_add(&ca->alloc_heap, e, bucket_alloc_cmp, NULL);
                        if (heap_full(&ca->alloc_heap))
                                break;
                }
@@ -659,7 +661,7 @@ static void find_reclaimable_buckets_random(struct bch_fs *c, struct bch_dev *ca
                if (bch2_can_invalidate_bucket(ca, b, m)) {
                        struct alloc_heap_entry e = { .bucket = b, .nr = 1, };
 
-                       heap_add(&ca->alloc_heap, e, bucket_alloc_cmp);
+                       heap_add(&ca->alloc_heap, e, bucket_alloc_cmp, NULL);
                        if (heap_full(&ca->alloc_heap))
                                break;
                }
@@ -697,7 +699,7 @@ static size_t find_reclaimable_buckets(struct bch_fs *c, struct bch_dev *ca)
                break;
        }
 
-       heap_resort(&ca->alloc_heap, bucket_alloc_cmp);
+       heap_resort(&ca->alloc_heap, bucket_alloc_cmp, NULL);
 
        for (i = 0; i < ca->alloc_heap.used; i++)
                nr += ca->alloc_heap.data[i].nr;
@@ -718,7 +720,7 @@ static inline long next_alloc_bucket(struct bch_dev *ca)
                        return b;
                }
 
-               heap_pop(&ca->alloc_heap, e, bucket_alloc_cmp);
+               heap_pop(&ca->alloc_heap, e, bucket_alloc_cmp, NULL);
        }
 
        return -1;