diff options
author | Kent Overstreet <kmo@daterainc.com> | 2014-02-28 02:51:12 +0100 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2014-03-18 20:24:54 +0100 |
commit | 3a2fd9d5090b83aab85378a846fa10f39b0b5aa7 (patch) | |
tree | 13862a06f381010ba9716441d4f844d953472670 /drivers/md/bcache/btree.c | |
parent | bcache: Kill unused freelist (diff) | |
download | linux-3a2fd9d5090b83aab85378a846fa10f39b0b5aa7.tar.xz linux-3a2fd9d5090b83aab85378a846fa10f39b0b5aa7.zip |
bcache: Kill bucket->gc_gen
gc_gen was a temporary used to recalculate last_gc, but since we only need
bucket->last_gc when gc isn't running (gc_mark_valid = 1), we can just update
last_gc directly.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/btree.c')
-rw-r--r-- | drivers/md/bcache/btree.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c index 4c340c85b122..7347b6100961 100644 --- a/drivers/md/bcache/btree.c +++ b/drivers/md/bcache/btree.c @@ -1178,8 +1178,8 @@ static uint8_t __bch_btree_mark_key(struct cache_set *c, int level, g = PTR_BUCKET(c, k, i); - if (gen_after(g->gc_gen, PTR_GEN(k, i))) - g->gc_gen = PTR_GEN(k, i); + if (gen_after(g->last_gc, PTR_GEN(k, i))) + g->last_gc = PTR_GEN(k, i); if (ptr_stale(c, k, i)) { stale = max(stale, ptr_stale(c, k, i)); @@ -1631,7 +1631,7 @@ static void btree_gc_start(struct cache_set *c) for_each_cache(ca, c, i) for_each_bucket(b, ca) { - b->gc_gen = b->gen; + b->last_gc = b->gen; if (!atomic_read(&b->pin)) { SET_GC_MARK(b, 0); SET_GC_SECTORS_USED(b, 0); @@ -1693,7 +1693,6 @@ static size_t bch_btree_gc_finish(struct cache_set *c) SET_GC_MARK(ca->buckets + *i, GC_MARK_METADATA); for_each_bucket(b, ca) { - b->last_gc = b->gc_gen; c->need_gc = max(c->need_gc, bucket_gc_gen(b)); if (atomic_read(&b->pin)) |