]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
bcache: replace hard coded number with BUCKET_GC_GEN_MAX
authorColy Li <colyli@suse.de>
Mon, 8 Oct 2018 12:41:18 +0000 (20:41 +0800)
committerJens Axboe <axboe@kernel.dk>
Mon, 8 Oct 2018 14:19:55 +0000 (08:19 -0600)
In extents.c:bch_extent_bad(), number 96 is used as parameter to call
btree_bug_on(). The purpose is to check whether stale gen value exceeds
BUCKET_GC_GEN_MAX, so it is better to use macro BUCKET_GC_GEN_MAX to
make the code more understandable.

Signed-off-by: Coly Li <colyli@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
drivers/md/bcache/extents.c

index c809724e6571e4be1d61ed0198a471ec8889c044..9560043666999f23a5d8e1d1391354ed05f9b64a 100644 (file)
@@ -553,7 +553,7 @@ static bool bch_extent_bad(struct btree_keys *bk, const struct bkey *k)
        for (i = 0; i < KEY_PTRS(k); i++) {
                stale = ptr_stale(b->c, k, i);
 
-               btree_bug_on(stale > 96, b,
+               btree_bug_on(stale > BUCKET_GC_GEN_MAX, b,
                             "key too stale: %i, need_gc %u",
                             stale, b->c->need_gc);