summaryrefslogtreecommitdiff
path: root/fs/bcachefs/bkey_sort.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-12-15 00:20:33 +0300
committerKent Overstreet <kent.overstreet@linux.dev>2023-10-23 00:08:32 +0300
commitae2f17d5ad02bc85a31d09c4396e177581abbb1f (patch)
treeed16f10ba7b6ef211c7048df3b2ec63b338bf954 /fs/bcachefs/bkey_sort.h
parent8f82280ea3871781e638d920d6dead58717bc13a (diff)
downloadlinux-ae2f17d5ad02bc85a31d09c4396e177581abbb1f.tar.xz
bcachefs: Kill btree_node_iter_large
Long overdue cleanup - this converts btree_node_iter_large uses to sort_iter. Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com> Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/bkey_sort.h')
-rw-r--r--fs/bcachefs/bkey_sort.h26
1 files changed, 8 insertions, 18 deletions
diff --git a/fs/bcachefs/bkey_sort.h b/fs/bcachefs/bkey_sort.h
index 47a808670341..458a051fdac5 100644
--- a/fs/bcachefs/bkey_sort.h
+++ b/fs/bcachefs/bkey_sort.h
@@ -2,20 +2,10 @@
#ifndef _BCACHEFS_BKEY_SORT_H
#define _BCACHEFS_BKEY_SORT_H
-struct btree_node_iter_large {
- u16 used;
-
- struct btree_node_iter_set data[MAX_BSETS];
-};
-
-void bch2_btree_node_iter_large_push(struct btree_node_iter_large *,
- struct btree *,
- const struct bkey_packed *,
- const struct bkey_packed *);
-
struct sort_iter {
- struct btree *b;
+ struct btree *b;
unsigned used;
+ unsigned size;
struct sort_iter_set {
struct bkey_packed *k, *end;
@@ -24,27 +14,27 @@ struct sort_iter {
static inline void sort_iter_init(struct sort_iter *iter, struct btree *b)
{
- memset(iter, 0, sizeof(*iter));
iter->b = b;
+ iter->used = 0;
+ iter->size = ARRAY_SIZE(iter->data);
}
static inline void sort_iter_add(struct sort_iter *iter,
struct bkey_packed *k,
struct bkey_packed *end)
{
- BUG_ON(iter->used >= ARRAY_SIZE(iter->data));
+ BUG_ON(iter->used >= iter->size);
if (k != end)
iter->data[iter->used++] = (struct sort_iter_set) { k, end };
}
struct btree_nr_keys
-bch2_key_sort_fix_overlapping(struct bset *, struct btree *,
- struct btree_node_iter_large *);
+bch2_key_sort_fix_overlapping(struct bch_fs *, struct bset *,
+ struct sort_iter *);
struct btree_nr_keys
bch2_extent_sort_fix_overlapping(struct bch_fs *, struct bset *,
- struct btree *,
- struct btree_node_iter_large *);
+ struct sort_iter *);
struct btree_nr_keys
bch2_sort_repack(struct bset *, struct btree *,