summaryrefslogtreecommitdiff
path: root/libbcachefs/alloc_background.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-03-03 00:39:26 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-03-03 00:39:26 -0500
commit1ee7dc7a55273d34358a0ee525a9e823c999ffe6 (patch)
treea4fa4357fe99c483b08458a1fcc0de304cb1eb25 /libbcachefs/alloc_background.h
parentd010a21653d34d80044c5a1d7702802b264a2a6c (diff)
Update bcachefs sources to 2272c5f5b7 bcachefs: Mark stripe buckets with correct data type
Diffstat (limited to 'libbcachefs/alloc_background.h')
-rw-r--r--libbcachefs/alloc_background.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/libbcachefs/alloc_background.h b/libbcachefs/alloc_background.h
index 96ac8f39..1aa7c7a0 100644
--- a/libbcachefs/alloc_background.h
+++ b/libbcachefs/alloc_background.h
@@ -44,10 +44,10 @@ static inline enum bch_data_type __alloc_data_type(u32 dirty_sectors,
struct bch_alloc_v4 a,
enum bch_data_type data_type)
{
+ if (stripe)
+ return data_type == BCH_DATA_parity ? data_type : BCH_DATA_stripe;
if (dirty_sectors)
return data_type;
- if (stripe)
- return BCH_DATA_stripe;
if (cached_sectors)
return BCH_DATA_cached;
if (BCH_ALLOC_V4_NEED_DISCARD(&a))
@@ -64,6 +64,11 @@ static inline enum bch_data_type alloc_data_type(struct bch_alloc_v4 a,
a.stripe, a, data_type);
}
+static inline enum bch_data_type bucket_data_type(enum bch_data_type data_type)
+{
+ return data_type == BCH_DATA_stripe ? BCH_DATA_user : data_type;
+}
+
static inline u64 alloc_lru_idx_read(struct bch_alloc_v4 a)
{
return a.data_type == BCH_DATA_cached ? a.io_time[READ] : 0;