diff options
| author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-23 16:34:03 -0500 |
|---|---|---|
| committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-07-14 19:00:12 -0400 |
| commit | 2612e29142ff718e6f120c62e6792f0a67fd3005 (patch) | |
| tree | 4478842165cbf2aaf7a5c9b9dae7335f2431e741 /fs/bcachefs/alloc_background.h | |
| parent | 55f7962da3bb2d34525c1973189413a113667a24 (diff) | |
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.h | 5 |
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) { |
