summaryrefslogtreecommitdiff
path: root/fs/bcachefs/ec_types.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2021-12-05 07:07:33 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:09:18 +0300
commit990d42d1873c16b6080c887f6bb27e56c0f885cf (patch)
treea638e00b4d0337d74f26304fbc23d9a294f4fff7 /fs/bcachefs/ec_types.h
parentf54788cc8c79cad2ac8016d1c4a8a1373a4d7707 (diff)
downloadlinux-990d42d1873c16b6080c887f6bb27e56c0f885cf.tar.xz
bcachefs: Split out struct gc_stripe from struct stripe
We have two radix trees of stripes - one that mirrors some information from the stripes btree in normal operation, and another that GC uses to recalculate block usage counts. The normal one is now only used for finding partially empty stripes in order to reuse them - the normal stripes radix tree and the GC stripes radix tree are used significantly differently, so this patch splits them into separate types. In an upcoming patch we'll be replacing c->stripes with a btree that indexes stripes by the order we want to reuse them. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
Diffstat (limited to 'fs/bcachefs/ec_types.h')
-rw-r--r--fs/bcachefs/ec_types.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/fs/bcachefs/ec_types.h b/fs/bcachefs/ec_types.h
index 3fc31222459a..edd93da663c1 100644
--- a/fs/bcachefs/ec_types.h
+++ b/fs/bcachefs/ec_types.h
@@ -21,6 +21,15 @@ struct stripe {
unsigned alive:1; /* does a corresponding key exist in stripes btree? */
unsigned on_heap:1;
u8 blocks_nonempty;
+};
+
+struct gc_stripe {
+ u16 sectors;
+
+ u8 nr_blocks;
+ u8 nr_redundant;
+
+ unsigned alive:1; /* does a corresponding key exist in stripes btree? */
u16 block_sectors[BCH_BKEY_PTRS_MAX];
struct bch_extent_ptr ptrs[BCH_BKEY_PTRS_MAX];