diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-10-24 16:36:03 -0700 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-10 21:56:34 -0800 |
commit | 280481d06c8a683d9aaa26125476222e76b733c5 (patch) | |
tree | 513b7387da60b3d497a108335f743369106eb7a3 /drivers/md/bcache/alloc.c | |
parent | e58ff155034791ed3a5563d24a50fae0a8c1617c (diff) | |
download | linux-stable-280481d06c8a683d9aaa26125476222e76b733c5.tar.gz linux-stable-280481d06c8a683d9aaa26125476222e76b733c5.tar.bz2 linux-stable-280481d06c8a683d9aaa26125476222e76b733c5.zip |
bcache: Debug code improvements
Couple changes:
* Consolidate bch_check_keys() and bch_check_key_order(), and move the
checks that only check_key_order() could do to bch_btree_iter_next().
* Get rid of CONFIG_BCACHE_EDEBUG - now, all that code is compiled in
when CONFIG_BCACHE_DEBUG is enabled, and there's now a sysfs file to
flip on the EDEBUG checks at runtime.
* Dropped an old not terribly useful check in rw_unlock(), and
refactored/improved a some of the other debug code.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/alloc.c')
-rw-r--r-- | drivers/md/bcache/alloc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/md/bcache/alloc.c b/drivers/md/bcache/alloc.c index 4970ddc6a7f6..ed5920b20c61 100644 --- a/drivers/md/bcache/alloc.c +++ b/drivers/md/bcache/alloc.c @@ -398,8 +398,7 @@ long bch_bucket_alloc(struct cache *ca, unsigned watermark, bool wait) out: wake_up_process(ca->alloc_thread); -#ifdef CONFIG_BCACHE_EDEBUG - { + if (expensive_debug_checks(ca->set)) { size_t iter; long i; @@ -413,7 +412,7 @@ out: fifo_for_each(i, &ca->unused, iter) BUG_ON(i == r); } -#endif + b = ca->buckets + r; BUG_ON(atomic_read(&b->pin) != 1); |