summaryrefslogtreecommitdiff
path: root/libbcachefs/bkey.h
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2018-07-16 03:58:54 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2018-07-16 04:00:44 -0400
commit76a549d82d1383c02e4aa6f7d9eda2df9f2196b3 (patch)
tree99dd635807dd308586ed45677b90140e3ab60599 /libbcachefs/bkey.h
parent75c7148e0aff2184c75a52e7c4c58e46e715757b (diff)
Update bcachefs sources to eab3b355cf bcachefs: trace transaction restarts
Diffstat (limited to 'libbcachefs/bkey.h')
-rw-r--r--libbcachefs/bkey.h8
1 files changed, 3 insertions, 5 deletions
diff --git a/libbcachefs/bkey.h b/libbcachefs/bkey.h
index 2f62bd8e..bd1d21b0 100644
--- a/libbcachefs/bkey.h
+++ b/libbcachefs/bkey.h
@@ -206,14 +206,12 @@ void bch2_bkey_swab_key(const struct bkey_format *, struct bkey_packed *);
static __always_inline int bversion_cmp(struct bversion l, struct bversion r)
{
- if (l.hi != r.hi)
- return l.hi < r.hi ? -1 : 1;
- if (l.lo != r.lo)
- return l.lo < r.lo ? -1 : 1;
- return 0;
+ return (l.hi > r.hi) - (l.hi < r.hi) ?:
+ (l.lo > r.lo) - (l.lo < r.lo);
}
#define ZERO_VERSION ((struct bversion) { .hi = 0, .lo = 0 })
+#define MAX_VERSION ((struct bversion) { .hi = ~0, .lo = ~0ULL })
static __always_inline int bversion_zero(struct bversion v)
{