diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-10-24 20:19:26 -0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-11 00:56:04 -0500 |
commit | 72a44517f3ca3725dc86081d105457df46448679 (patch) | |
tree | 247b859af6c4377ab1ea90fd1fd4e64278ccdbbd /drivers/md/bcache/btree.h | |
parent | 35fcd848d72683141052aa9880542461577f2dbe (diff) |
bcache: Convert gc to a kthread
We needed a dedicated rescuer workqueue for gc anyways... and gc was
conceptually a dedicated thread, just one that wasn't running all the
time. Switch it to a dedicated thread to make the code a bit more
straightforward.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/btree.h')
-rw-r--r-- | drivers/md/bcache/btree.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/md/bcache/btree.h b/drivers/md/bcache/btree.h index d691d954730e..fa9641aaed39 100644 --- a/drivers/md/bcache/btree.h +++ b/drivers/md/bcache/btree.h | |||
@@ -388,12 +388,18 @@ int bch_btree_insert(struct btree_op *, struct cache_set *, struct keylist *); | |||
388 | 388 | ||
389 | int bch_btree_search_recurse(struct btree *, struct btree_op *); | 389 | int bch_btree_search_recurse(struct btree *, struct btree_op *); |
390 | 390 | ||
391 | void bch_queue_gc(struct cache_set *); | 391 | int bch_gc_thread_start(struct cache_set *); |
392 | size_t bch_btree_gc_finish(struct cache_set *); | 392 | size_t bch_btree_gc_finish(struct cache_set *); |
393 | void bch_moving_gc(struct closure *); | 393 | void bch_moving_gc(struct cache_set *); |
394 | int bch_btree_check(struct cache_set *, struct btree_op *); | 394 | int bch_btree_check(struct cache_set *, struct btree_op *); |
395 | uint8_t __bch_btree_mark_key(struct cache_set *, int, struct bkey *); | 395 | uint8_t __bch_btree_mark_key(struct cache_set *, int, struct bkey *); |
396 | 396 | ||
397 | static inline void wake_up_gc(struct cache_set *c) | ||
398 | { | ||
399 | if (c->gc_thread) | ||
400 | wake_up_process(c->gc_thread); | ||
401 | } | ||
402 | |||
397 | void bch_keybuf_init(struct keybuf *); | 403 | void bch_keybuf_init(struct keybuf *); |
398 | void bch_refill_keybuf(struct cache_set *, struct keybuf *, struct bkey *, | 404 | void bch_refill_keybuf(struct cache_set *, struct keybuf *, struct bkey *, |
399 | keybuf_pred_fn *); | 405 | keybuf_pred_fn *); |