diff options
Diffstat (limited to 'libbcachefs/bkey.h')
-rw-r--r-- | libbcachefs/bkey.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libbcachefs/bkey.h b/libbcachefs/bkey.h index fcd43915..93635714 100644 --- a/libbcachefs/bkey.h +++ b/libbcachefs/bkey.h @@ -194,6 +194,13 @@ static inline struct bpos bkey_max(struct bpos l, struct bpos r) return bkey_gt(l, r) ? l : r; } +static inline bool bkey_and_val_eq(struct bkey_s_c l, struct bkey_s_c r) +{ + return bpos_eq(l.k->p, r.k->p) && + bkey_bytes(l.k) == bkey_bytes(r.k) && + !memcmp(l.v, r.v, bkey_val_bytes(l.k)); +} + void bch2_bpos_swab(struct bpos *); void bch2_bkey_swab_key(const struct bkey_format *, struct bkey_packed *); |