diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-11-23 17:17:38 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2024-01-01 11:47:38 -0500 |
commit | 3b05b8e08292eafec277e8780d79b2a2d8584af2 (patch) | |
tree | 41d8333a7c8efa49815d3b7374d9d545094c71ed /fs/bcachefs/buckets.c | |
parent | 011173321f6fb36f47c3aaaf04218bf758b29e17 (diff) | |
download | lwn-3b05b8e08292eafec277e8780d79b2a2d8584af2.tar.gz lwn-3b05b8e08292eafec277e8780d79b2a2d8584af2.zip |
bcachefs: Simplify check_bucket_ref()
We only need the sector count being modified.
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/buckets.c')
-rw-r--r-- | fs/bcachefs/buckets.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/fs/bcachefs/buckets.c b/fs/bcachefs/buckets.c index 0908da5e9886..ee3a2f5271c3 100644 --- a/fs/bcachefs/buckets.c +++ b/fs/bcachefs/buckets.c @@ -657,14 +657,11 @@ static int check_bucket_ref(struct btree_trans *trans, const struct bch_extent_ptr *ptr, s64 sectors, enum bch_data_type ptr_data_type, u8 b_gen, u8 bucket_data_type, - u32 dirty_sectors, u32 cached_sectors) + u32 bucket_sectors) { struct bch_fs *c = trans->c; struct bch_dev *ca = bch_dev_bkey_exists(c, ptr->dev); size_t bucket_nr = PTR_BUCKET_NR(ca, ptr); - u32 bucket_sectors = !ptr->cached - ? dirty_sectors - : cached_sectors; struct printbuf buf = PRINTBUF; int ret = 0; @@ -799,7 +796,7 @@ static int mark_stripe_bucket(struct btree_trans *trans, ret = check_bucket_ref(trans, k, ptr, sectors, data_type, g->gen, g->data_type, - g->dirty_sectors, g->cached_sectors); + g->dirty_sectors); if (ret) goto err; @@ -829,8 +826,7 @@ static int __mark_pointer(struct btree_trans *trans, ? dirty_sectors : cached_sectors; int ret = check_bucket_ref(trans, k, ptr, sectors, ptr_data_type, - bucket_gen, *bucket_data_type, - *dirty_sectors, *cached_sectors); + bucket_gen, *bucket_data_type, *dst_sectors); if (ret) return ret; @@ -1563,7 +1559,7 @@ static int bch2_trans_mark_stripe_bucket(struct btree_trans *trans, ret = check_bucket_ref(trans, s.s_c, ptr, sectors, data_type, a->v.gen, a->v.data_type, - a->v.dirty_sectors, a->v.cached_sectors); + a->v.dirty_sectors); if (ret) goto err; |