summaryrefslogtreecommitdiff
path: root/libbcachefs/btree_write_buffer.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@linux.dev>2023-12-30 16:04:21 -0500
committerKent Overstreet <kent.overstreet@linux.dev>2023-12-30 16:04:21 -0500
commit378ae738d5ea505c1751f23b4c56e03bb2422f33 (patch)
treef6661f7afe2e70703a224b29fcc9f5f2d56ab1fc /libbcachefs/btree_write_buffer.c
parent44bf7868e5c2c4a52aef67e55aab1e904147dad4 (diff)
Update bcachefs sources to 5264e9f4d0c0 bcachefs: fix setting version_upgrade_complete
Diffstat (limited to 'libbcachefs/btree_write_buffer.c')
-rw-r--r--libbcachefs/btree_write_buffer.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/libbcachefs/btree_write_buffer.c b/libbcachefs/btree_write_buffer.c
index 16506032..5c1169c7 100644
--- a/libbcachefs/btree_write_buffer.c
+++ b/libbcachefs/btree_write_buffer.c
@@ -17,14 +17,14 @@ static int bch2_btree_write_buffer_journal_flush(struct journal *,
static int bch2_journal_keys_to_write_buffer(struct bch_fs *, struct journal_buf *);
-static inline bool __wb_key_cmp(const struct wb_key_ref *l, const struct wb_key_ref *r)
+static inline bool __wb_key_ref_cmp(const struct wb_key_ref *l, const struct wb_key_ref *r)
{
return (cmp_int(l->hi, r->hi) ?:
cmp_int(l->mi, r->mi) ?:
cmp_int(l->lo, r->lo)) >= 0;
}
-static inline bool wb_key_cmp(const struct wb_key_ref *l, const struct wb_key_ref *r)
+static inline bool wb_key_ref_cmp(const struct wb_key_ref *l, const struct wb_key_ref *r)
{
#ifdef CONFIG_X86_64
int cmp;
@@ -39,10 +39,10 @@ static inline bool wb_key_cmp(const struct wb_key_ref *l, const struct wb_key_re
: [l] "r" (l), [r] "r" (r)
: "rax", "cc");
- EBUG_ON(cmp != __wb_key_cmp(l, r));
+ EBUG_ON(cmp != __wb_key_ref_cmp(l, r));
return cmp;
#else
- return __wb_key_cmp(l, r);
+ return __wb_key_ref_cmp(l, r);
#endif
}
@@ -87,12 +87,12 @@ static noinline void wb_sort(struct wb_key_ref *base, size_t num)
* average, 3/4 worst-case.)
*/
for (b = a; c = 2*b + 1, (d = c + 1) < n;)
- b = wb_key_cmp(base + c, base + d) ? c : d;
+ b = wb_key_ref_cmp(base + c, base + d) ? c : d;
if (d == n) /* Special case last leaf with no sibling */
b = c;
/* Now backtrack from "b" to the correct location for "a" */
- while (b != a && wb_key_cmp(base + a, base + b))
+ while (b != a && wb_key_ref_cmp(base + a, base + b))
b = (b - 1) / 2;
c = b; /* Where "a" belongs */
while (b != a) { /* Shift it into place */
@@ -484,7 +484,7 @@ static void bch2_btree_write_buffer_flush_work(struct work_struct *work)
bch2_write_ref_put(c, BCH_WRITE_REF_btree_write_buffer);
}
-int __bch2_journal_key_to_wb(struct bch_fs *c,
+int bch2_journal_key_to_wb_slowpath(struct bch_fs *c,
struct journal_keys_to_wb *dst,
enum btree_id btree, struct bkey_i *k)
{