summaryrefslogtreecommitdiff
path: root/fs/bcachefs
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-11-08 15:09:36 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-22 17:08:31 -0400
commitf7f21ed382ea84f2dd4c448c7d937242a4dbbf97 (patch)
treea224c32c2ef733a8465b1f77e6ebda8327f7c472 /fs/bcachefs
parentb904a7991802d2fba1f8c59e6f0790021342c0ff (diff)
bcachefs: Remove some BKEY_PADDED uses
Prep work for extents with inline data Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs')
-rw-r--r--fs/bcachefs/bkey_sort.c8
-rw-r--r--fs/bcachefs/extents.c17
2 files changed, 9 insertions, 16 deletions
diff --git a/fs/bcachefs/bkey_sort.c b/fs/bcachefs/bkey_sort.c
index e32fad5a91ac..2cac269b386f 100644
--- a/fs/bcachefs/bkey_sort.c
+++ b/fs/bcachefs/bkey_sort.c
@@ -418,7 +418,7 @@ bch2_sort_repack_merge(struct bch_fs *c,
struct bkey_packed *prev = NULL, *k_packed;
struct bkey_s k;
struct btree_nr_keys nr;
- BKEY_PADDED(k) tmp;
+ struct bkey unpacked;
memset(&nr, 0, sizeof(nr));
@@ -426,11 +426,7 @@ bch2_sort_repack_merge(struct bch_fs *c,
if (filter_whiteouts && bkey_whiteout(k_packed))
continue;
- EBUG_ON(bkeyp_val_u64s(&src->format, k_packed) >
- BKEY_EXTENT_VAL_U64s_MAX);
-
- bch2_bkey_unpack(src, &tmp.k, k_packed);
- k = bkey_i_to_s(&tmp.k);
+ k = __bkey_disassemble(src, k_packed, &unpacked);
if (filter_whiteouts &&
bch2_bkey_normalize(c, k))
diff --git a/fs/bcachefs/extents.c b/fs/bcachefs/extents.c
index 201f4953acac..3cd0a79f8fe6 100644
--- a/fs/bcachefs/extents.c
+++ b/fs/bcachefs/extents.c
@@ -1217,7 +1217,6 @@ void bch2_insert_fixup_extent(struct btree_trans *trans,
struct bkey_i whiteout = *insert;
struct bkey_packed *_k;
struct bkey unpacked;
- BKEY_PADDED(k) tmp;
EBUG_ON(iter->level);
EBUG_ON(!insert->k.size);
@@ -1291,25 +1290,23 @@ next:
bch2_btree_iter_set_pos_same_leaf(iter, insert->k.p);
if (update_btree) {
- bkey_copy(&tmp.k, insert);
-
if (deleting)
- tmp.k.k.type = KEY_TYPE_discard;
+ insert->k.type = KEY_TYPE_discard;
- EBUG_ON(bkey_deleted(&tmp.k.k) || !tmp.k.k.size);
+ EBUG_ON(bkey_deleted(&insert->k) || !insert->k.size);
- extent_bset_insert(c, iter, &tmp.k);
+ extent_bset_insert(c, iter, insert);
}
if (update_journal) {
- bkey_copy(&tmp.k, !deleting ? insert : &whiteout);
+ struct bkey_i *k = !deleting ? insert : &whiteout;
if (deleting)
- tmp.k.k.type = KEY_TYPE_discard;
+ k->k.type = KEY_TYPE_discard;
- EBUG_ON(bkey_deleted(&tmp.k.k) || !tmp.k.k.size);
+ EBUG_ON(bkey_deleted(&k->k) || !k->k.size);
- bch2_btree_journal_key(trans, iter, &tmp.k);
+ bch2_btree_journal_key(trans, iter, k);
}
bch2_cut_front(insert->k.p, insert);