diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-11-25 20:53:51 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:15 -0400 |
commit | 61c8d7c8eb0e0169e04df64fab45c575aaad0739 (patch) | |
tree | ce46b86865189db93f925915d4a030254fd440d4 /fs/bcachefs/btree_gc.c | |
parent | ed1646ca7412151dbdd81f4e4d05437cc99e9c8c (diff) | |
download | lwn-61c8d7c8eb0e0169e04df64fab45c575aaad0739.tar.gz lwn-61c8d7c8eb0e0169e04df64fab45c575aaad0739.zip |
bcachefs: Persist stripe blocks_used
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_gc.c')
-rw-r--r-- | fs/bcachefs/btree_gc.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fs/bcachefs/btree_gc.c b/fs/bcachefs/btree_gc.c index a725a106f6dc..b63dcbdb95c0 100644 --- a/fs/bcachefs/btree_gc.c +++ b/fs/bcachefs/btree_gc.c @@ -561,6 +561,7 @@ static void bch2_gc_done(struct bch_fs *c, bool initial) dst_iter.pos, ##__VA_ARGS__, \ dst->_f, src->_f); \ dst->_f = src->_f; \ + dst->dirty = true; \ } #define copy_bucket_field(_f) \ if (dst->b[b].mark._f != src->b[b].mark._f) { \ @@ -591,16 +592,18 @@ static void bch2_gc_done(struct bch_fs *c, bool initial) while ((dst = genradix_iter_peek(&dst_iter, &c->stripes[0])) && (src = genradix_iter_peek(&src_iter, &c->stripes[1]))) { + BUG_ON(src_iter.pos != dst_iter.pos); + copy_stripe_field(alive, "alive"); copy_stripe_field(sectors, "sectors"); copy_stripe_field(algorithm, "algorithm"); copy_stripe_field(nr_blocks, "nr_blocks"); copy_stripe_field(nr_redundant, "nr_redundant"); - copy_stripe_field(blocks_nonempty.counter, + copy_stripe_field(blocks_nonempty, "blocks_nonempty"); for (i = 0; i < ARRAY_SIZE(dst->block_sectors); i++) - copy_stripe_field(block_sectors[i].counter, + copy_stripe_field(block_sectors[i], "block_sectors[%u]", i); if (dst->alive) |