bcachefs: Mark stripe buckets with correct data type
authorKent Overstreet <kent.overstreet@linux.dev>
Thu, 2 Mar 2023 02:47:07 +0000 (21:47 -0500)
committerKent Overstreet <kent.overstreet@linux.dev>
Sun, 22 Oct 2023 21:09:55 +0000 (17:09 -0400)
commit910659763edaba58aa04bd5924dd933bc08cc56f
tree572a22a75d5a45db070052e7830b13088426e00d
parent3329cf1bb91d6293a96cf35ad72b2a2e1e1c0e3d
bcachefs: Mark stripe buckets with correct data type

Currently, we don't use bucket data type for tracking whether buckets
are part of a stripe; parity buckets are BCH_DATA_parity, but data
buckets in a stripe are BCH_DATA_user. There's a separate counter,
buckets_ec, outside the BCH_DATA_TYPES system for tracking number of
buckets on a device that are part of a stripe.

The trouble with this approach is that it's too coarse grained, and we
need better information on fragmentation for debugging copygc.

With this patch, data buckets in a stripe are now tracked as
BCH_DATA_stripe buckets.

This doesn't yet differentiate between erasure coded and non-erasure
coded data in a stripe bucket, nor do we yet track empty data buckets in
stripes.

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
fs/bcachefs/alloc_background.h
fs/bcachefs/backpointers.h
fs/bcachefs/btree_gc.c
fs/bcachefs/buckets.c
fs/bcachefs/movinggc.c