summaryrefslogtreecommitdiff
path: root/libbcachefs/bset.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2020-01-21 17:24:32 -0500
committerKent Overstreet <kent.overstreet@gmail.com>2020-01-21 17:24:32 -0500
commite0eb64c84601b2bbae055df809dd21f95f85c034 (patch)
tree85ac2fd5b2092ab96646cf05c00ce10d22f27088 /libbcachefs/bset.h
parent4d697aa315701e238e93e77947ac7ee61f10c578 (diff)
Update bcachefs sources to 3cd63315a6 bcachefs: Track incompressible data
Diffstat (limited to 'libbcachefs/bset.h')
-rw-r--r--libbcachefs/bset.h36
1 files changed, 15 insertions, 21 deletions
diff --git a/libbcachefs/bset.h b/libbcachefs/bset.h
index 2653a74b..7338ccbc 100644
--- a/libbcachefs/bset.h
+++ b/libbcachefs/bset.h
@@ -199,12 +199,6 @@ __bkey_unpack_key_format_checked(const struct btree *b,
if (btree_keys_expensive_checks(b)) {
struct bkey dst2 = __bch2_bkey_unpack_key(&b->format, src);
- /*
- * hack around a harmless race when compacting whiteouts
- * for a write:
- */
- dst2.needs_whiteout = dst->needs_whiteout;
-
BUG_ON(memcmp(dst, &dst2, sizeof(*dst)));
}
}
@@ -360,7 +354,7 @@ void bch2_bset_delete(struct btree *, struct bkey_packed *, unsigned);
static inline int bkey_cmp_p_or_unp(const struct btree *b,
const struct bkey_packed *l,
const struct bkey_packed *r_packed,
- struct bpos *r)
+ const struct bpos *r)
{
EBUG_ON(r_packed && !bkey_packed(r_packed));
@@ -449,7 +443,7 @@ static inline bool bch2_btree_node_iter_end(struct btree_node_iter *iter)
* XXX: only need to compare pointers for keys that are both within a
* btree_node_iterator - we need to break ties for prev() to work correctly
*/
-static inline int bkey_iter_cmp(struct btree *b,
+static inline int bkey_iter_cmp(const struct btree *b,
const struct bkey_packed *l,
const struct bkey_packed *r)
{
@@ -458,7 +452,7 @@ static inline int bkey_iter_cmp(struct btree *b,
?: cmp_int(l, r);
}
-static inline int btree_node_iter_cmp(struct btree *b,
+static inline int btree_node_iter_cmp(const struct btree *b,
struct btree_node_iter_set l,
struct btree_node_iter_set r)
{
@@ -467,22 +461,22 @@ static inline int btree_node_iter_cmp(struct btree *b,
__btree_node_offset_to_key(b, r.k));
}
-/* These assume l (the search key) is not a deleted key: */
-static inline int bkey_iter_pos_cmp(struct btree *b,
- struct bpos *l,
- const struct bkey_packed *r)
+/* These assume r (the search key) is not a deleted key: */
+static inline int bkey_iter_pos_cmp(const struct btree *b,
+ const struct bkey_packed *l,
+ const struct bpos *r)
{
- return -bkey_cmp_left_packed(b, r, l)
- ?: (int) bkey_deleted(r);
+ return bkey_cmp_left_packed(b, l, r)
+ ?: -((int) bkey_deleted(l));
}
-static inline int bkey_iter_cmp_p_or_unp(struct btree *b,
- struct bpos *l,
- const struct bkey_packed *l_packed,
- const struct bkey_packed *r)
+static inline int bkey_iter_cmp_p_or_unp(const struct btree *b,
+ const struct bkey_packed *l,
+ const struct bkey_packed *r_packed,
+ const struct bpos *r)
{
- return -bkey_cmp_p_or_unp(b, r, l_packed, l)
- ?: (int) bkey_deleted(r);
+ return bkey_cmp_p_or_unp(b, l, r_packed, r)
+ ?: -((int) bkey_deleted(l));
}
static inline struct bkey_packed *