summaryrefslogtreecommitdiffstats
path: root/fs/bcachefs/alloc_background.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-11-23 22:34:03 +0100
committerKent Overstreet <kent.overstreet@linux.dev>2024-07-15 01:00:12 +0200
commit2612e29142ff718e6f120c62e6792f0a67fd3005 (patch)
tree4478842165cbf2aaf7a5c9b9dae7335f2431e741 /fs/bcachefs/alloc_background.h
parentbcachefs: bch_alloc->stripe_sectors (diff)
downloadlinux-2612e29142ff718e6f120c62e6792f0a67fd3005.tar.xz
linux-2612e29142ff718e6f120c62e6792f0a67fd3005.zip
bcachefs: BCH_DATA_unstriped
Add a new pseudo data type, to track buckets that are members of a stripe, but have unstriped data in them. Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/alloc_background.h')
-rw-r--r--fs/bcachefs/alloc_background.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/bcachefs/alloc_background.h b/fs/bcachefs/alloc_background.h
index d7eb9feb7a7e..a766eaf48863 100644
--- a/fs/bcachefs/alloc_background.h
+++ b/fs/bcachefs/alloc_background.h
@@ -100,6 +100,11 @@ static inline unsigned bch2_bucket_sectors_fragmented(struct bch_dev *ca,
return d ? max(0, ca->mi.bucket_size - d) : 0;
}
+static inline unsigned bch2_bucket_sectors_unstriped(struct bch_alloc_v4 a)
+{
+ return a.data_type == BCH_DATA_stripe ? a.dirty_sectors : 0;
+}
+
static inline enum bch_data_type alloc_data_type(struct bch_alloc_v4 a,
enum bch_data_type data_type)
{