diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2018-07-23 05:32:01 -0400 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@linux.dev> | 2023-10-22 17:08:12 -0400 |
commit | 9ca53b55f7415783c6cc8b751c99f2af6cc0a932 (patch) | |
tree | cef41ef35075c7bfaa765faf6ab9c5d58f0a56b4 /fs/bcachefs/btree_gc.h | |
parent | e647369168e02a06ff5ee229cc14ad72b2f5ddfd (diff) | |
download | linux-9ca53b55f7415783c6cc8b751c99f2af6cc0a932.tar.gz linux-9ca53b55f7415783c6cc8b751c99f2af6cc0a932.tar.bz2 linux-9ca53b55f7415783c6cc8b751c99f2af6cc0a932.zip |
bcachefs: gc now operates on second set of bucket marks
This means we can now use gc to verify the allocation information -
important for testing persistant alloc info
Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
Diffstat (limited to 'fs/bcachefs/btree_gc.h')
-rw-r--r-- | fs/bcachefs/btree_gc.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/fs/bcachefs/btree_gc.h b/fs/bcachefs/btree_gc.h index 47a590015325..bb77564b9463 100644 --- a/fs/bcachefs/btree_gc.h +++ b/fs/bcachefs/btree_gc.h @@ -7,7 +7,7 @@ enum bkey_type; void bch2_coalesce(struct bch_fs *); -void bch2_gc(struct bch_fs *); +int bch2_gc(struct bch_fs *, struct list_head *, bool); void bch2_gc_thread_stop(struct bch_fs *); int bch2_gc_thread_start(struct bch_fs *); int bch2_initial_gc(struct bch_fs *, struct list_head *); @@ -105,14 +105,14 @@ static inline struct gc_pos gc_pos_alloc(struct bch_fs *c, struct open_bucket *o }; } -static inline bool gc_will_visit(struct bch_fs *c, struct gc_pos pos) +static inline bool gc_visited(struct bch_fs *c, struct gc_pos pos) { unsigned seq; bool ret; do { seq = read_seqcount_begin(&c->gc_pos_lock); - ret = gc_pos_cmp(c->gc_pos, pos) < 0; + ret = gc_pos_cmp(pos, c->gc_pos) <= 0; } while (read_seqcount_retry(&c->gc_pos_lock, seq)); return ret; |