summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/btree.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-10-24 16:36:03 -0700
committerKent Overstreet <kmo@daterainc.com>2013-11-10 21:56:34 -0800
commit280481d06c8a683d9aaa26125476222e76b733c5 (patch)
tree513b7387da60b3d497a108335f743369106eb7a3 /drivers/md/bcache/btree.c
parente58ff155034791ed3a5563d24a50fae0a8c1617c (diff)
downloadop-kernel-dev-280481d06c8a683d9aaa26125476222e76b733c5.zip
op-kernel-dev-280481d06c8a683d9aaa26125476222e76b733c5.tar.gz
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/btree.c')
-rw-r--r--drivers/md/bcache/btree.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index aba787d..fa4d0b1 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -216,6 +216,10 @@ static void bch_btree_node_read_done(struct btree *b)
iter->size = b->c->sb.bucket_size / b->c->sb.block_size;
iter->used = 0;
+#ifdef CONFIG_BCACHE_DEBUG
+ iter->b = b;
+#endif
+
if (!i->seq)
goto err;
@@ -454,7 +458,7 @@ void bch_btree_node_write(struct btree *b, struct closure *parent)
BUG_ON(b->written >= btree_blocks(b));
BUG_ON(b->written && !i->keys);
BUG_ON(b->sets->data->seq != i->seq);
- bch_check_key_order(b, i);
+ bch_check_keys(b, "writing");
cancel_delayed_work(&b->work);
@@ -1917,7 +1921,7 @@ static bool bch_btree_insert_keys(struct btree *b, struct btree_op *op,
struct bkey *replace_key)
{
bool ret = false;
- unsigned oldsize = bch_count_data(b);
+ int oldsize = bch_count_data(b);
while (!bch_keylist_empty(insert_keys)) {
struct bset *i = write_block(b);
OpenPOWER on IntegriCloud