]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
bcachefs: bch2_blacklist_entries_gc cleanup
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 28 Jan 2025 09:32:47 +0000 (10:32 +0100)
committerKent Overstreet <kent.overstreet@linux.dev>
Sat, 15 Mar 2025 01:02:13 +0000 (21:02 -0400)
Use an eytzinger0_for_each() loop here.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/journal_seq_blacklist.c

index 1f25c111c54cdd342be1592d607fc5d926115a82..e463d2d95359589a5a97f01723e9630c0900bdc6 100644 (file)
@@ -231,15 +231,14 @@ bool bch2_blacklist_entries_gc(struct bch_fs *c)
        struct journal_seq_blacklist_table *t = c->journal_seq_blacklist_table;
        BUG_ON(nr != t->nr);
 
-       unsigned i;
-       for (src = bl->start, i = t->nr == 0 ? 0 : eytzinger0_first(t->nr);
-            src < bl->start + nr;
-            src++, i = eytzinger0_next(i, nr)) {
+       src = bl->start;
+       eytzinger0_for_each(i, nr) {
                BUG_ON(t->entries[i].start      != le64_to_cpu(src->start));
                BUG_ON(t->entries[i].end        != le64_to_cpu(src->end));
 
                if (t->entries[i].dirty || t->entries[i].end >= c->journal.oldest_seq_found_ondisk)
                        *dst++ = *src;
+               src++;
        }
 
        unsigned new_nr = dst - bl->start;