diff options
author | Kent Overstreet <kent.overstreet@linux.dev> | 2023-03-10 16:28:37 -0500 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:09:56 -0400 |
commit | 702ffea204840455e4f2d918538c39cc5c59666b (patch) | |
tree | 01eeae0e0b0aeb6b681025bf3a9be680d1abef2a /fs/bcachefs/data_update.c | |
parent | 3f5d3fb4025a7196e75250ecee8b6478f086a145 (diff) | |
download | linux-702ffea204840455e4f2d918538c39cc5c59666b.tar.gz linux-702ffea204840455e4f2d918538c39cc5c59666b.tar.bz2 linux-702ffea204840455e4f2d918538c39cc5c59666b.zip |
bcachefs: Extent helper improvements
- __bch2_bkey_drop_ptr() -> bch2_bkey_drop_ptr_noerror(), now available
outside extents.
- Split bch2_bkey_has_device() and bch2_bkey_has_device_c(), const and
non const versions
- bch2_extent_has_ptr() now returns the pointer it found
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/data_update.c')
-rw-r--r-- | fs/bcachefs/data_update.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/data_update.c b/fs/bcachefs/data_update.c index 26b351d48940..8332e8a0b05a 100644 --- a/fs/bcachefs/data_update.c +++ b/fs/bcachefs/data_update.c @@ -170,13 +170,13 @@ static int __bch2_data_update_index_update(struct btree_trans *trans, i = 0; bkey_for_each_ptr_decode(old.k, bch2_bkey_ptrs_c(old), p, entry) { if (((1U << i) & m->data_opts.rewrite_ptrs) && - bch2_extent_has_ptr(old, p, bkey_i_to_s_c(insert))) { + bch2_extent_has_ptr(old, p, bkey_i_to_s(insert))) { /* * If we're going to be adding a pointer to the * same device, we have to drop the old one - * otherwise, we can just mark it cached: */ - if (bch2_bkey_has_device(bkey_i_to_s_c(&new->k_i), p.ptr.dev)) + if (bch2_bkey_has_device_c(bkey_i_to_s_c(&new->k_i), p.ptr.dev)) bch2_bkey_drop_device_noerror(bkey_i_to_s(insert), p.ptr.dev); else bch2_bkey_mark_dev_cached(bkey_i_to_s(insert), p.ptr.dev); @@ -188,7 +188,7 @@ static int __bch2_data_update_index_update(struct btree_trans *trans, /* Add new ptrs: */ extent_for_each_ptr_decode(extent_i_to_s(new), p, entry) { const struct bch_extent_ptr *existing_ptr = - bch2_bkey_has_device(bkey_i_to_s_c(insert), p.ptr.dev); + bch2_bkey_has_device_c(bkey_i_to_s_c(insert), p.ptr.dev); if (existing_ptr && existing_ptr->cached) { /* |