summaryrefslogtreecommitdiff
path: root/libbcachefs/movinggc.c
diff options
context:
space:
mode:
authorKent Overstreet <kent.overstreet@gmail.com>2019-04-17 17:01:40 -0400
committerKent Overstreet <kent.overstreet@gmail.com>2019-04-17 19:00:38 -0400
commitb485aae1bac95e3b5be235116e2bc43da85906c5 (patch)
tree844734692f40b3e18bf35fbc9e3c3eb4a5610729 /libbcachefs/movinggc.c
parentf652fdc9622ee513469f046bceea81ada7fa5b02 (diff)
Update bcachefs sources to 6f603b8d79 bcachefs: some improvements to startup messages and options
Diffstat (limited to 'libbcachefs/movinggc.c')
-rw-r--r--libbcachefs/movinggc.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libbcachefs/movinggc.c b/libbcachefs/movinggc.c
index 12d33119..c6a4f5b9 100644
--- a/libbcachefs/movinggc.c
+++ b/libbcachefs/movinggc.c
@@ -53,7 +53,7 @@ static inline int sectors_used_cmp(copygc_heap *heap,
struct copygc_heap_entry l,
struct copygc_heap_entry r)
{
- return (l.sectors > r.sectors) - (l.sectors < r.sectors);
+ return cmp_int(l.sectors, r.sectors);
}
static int bucket_offset_cmp(const void *_l, const void *_r, size_t size)
@@ -61,7 +61,7 @@ static int bucket_offset_cmp(const void *_l, const void *_r, size_t size)
const struct copygc_heap_entry *l = _l;
const struct copygc_heap_entry *r = _r;
- return (l->offset > r->offset) - (l->offset < r->offset);
+ return cmp_int(l->offset, r->offset);
}
static bool __copygc_pred(struct bch_dev *ca,
@@ -115,7 +115,7 @@ static bool have_copygc_reserve(struct bch_dev *ca)
spin_lock(&ca->freelist_lock);
ret = fifo_full(&ca->free[RESERVE_MOVINGGC]) ||
- ca->allocator_blocked;
+ ca->allocator_state != ALLOCATOR_RUNNING;
spin_unlock(&ca->freelist_lock);
return ret;