summaryrefslogtreecommitdiff
path: root/fs/bcachefs/buckets.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-07-24 12:59:13 -0400
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:08 -0400
commita7c7a3092eb2a0313b535d05fb98817ef1efed0c (patch)
tree4a26027ea66f322389c5c837aa5e53e9dbb080e1 /fs/bcachefs/buckets.c
parent647d7b60b193967f113a47fcfd20102c4498f109 (diff)
downloadlwn-a7c7a3092eb2a0313b535d05fb98817ef1efed0c.tar.gz
lwn-a7c7a3092eb2a0313b535d05fb98817ef1efed0c.zip
bcachefs: bch2_mark_key() now takes bch_data_type
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r--fs/bcachefs/buckets.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c
index 65232f5e61bc..06ef268fd991 100644
--- a/fs/bcachefs/buckets.c
+++ b/fs/bcachefs/buckets.c
@@ -512,15 +512,13 @@ static void bch2_mark_pointer(struct bch_fs *c,
struct bkey_s_c_extent e,
const struct bch_extent_ptr *ptr,
struct bch_extent_crc_unpacked crc,
- s64 sectors, enum s_alloc type,
+ s64 sectors, enum bch_data_type data_type,
struct bch_fs_usage *stats,
u64 journal_seq, unsigned flags)
{
struct bucket_mark old, new;
struct bch_dev *ca = bch_dev_bkey_exists(c, ptr->dev);
struct bucket *g = PTR_BUCKET(ca, ptr);
- enum bch_data_type data_type = type == S_META
- ? BCH_DATA_BTREE : BCH_DATA_USER;
u64 v;
if (crc.compression_type) {
@@ -596,7 +594,7 @@ static void bch2_mark_pointer(struct bch_fs *c,
}
void bch2_mark_key(struct bch_fs *c, struct bkey_s_c k,
- s64 sectors, bool metadata,
+ s64 sectors, enum bch_data_type data_type,
struct gc_pos pos,
struct bch_fs_usage *stats,
u64 journal_seq, unsigned flags)
@@ -643,14 +641,14 @@ void bch2_mark_key(struct bch_fs *c, struct bkey_s_c k,
struct bkey_s_c_extent e = bkey_s_c_to_extent(k);
const struct bch_extent_ptr *ptr;
struct bch_extent_crc_unpacked crc;
- enum s_alloc type = metadata ? S_META : S_DIRTY;
+ enum s_alloc type = data_type == BCH_DATA_USER
+ ? S_DIRTY : S_META;
unsigned replicas = 0;
- BUG_ON(metadata && bkey_extent_is_cached(e.k));
BUG_ON(!sectors);
extent_for_each_ptr_crc(e, ptr, crc) {
- bch2_mark_pointer(c, e, ptr, crc, sectors, type,
+ bch2_mark_pointer(c, e, ptr, crc, sectors, data_type,
stats, journal_seq, flags);
replicas += !ptr->cached;
}