summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-09-10 22:40:56 -0700
committerKent Overstreet <kmo@daterainc.com>2013-10-03 15:23:43 -0700
commitc9135968033583f464be5ba65f1cdd7ac5681e08 (patch)
tree1dd47b0bb51c098333562ce261b52f0db00c9bbc
parent83ce2b2deb7b1f4fa89e5d320032e91f46638003 (diff)
bcache: Kill btree verify code
This code hasn't been used in ages and has probably rotted
-rw-r--r--drivers/md/bcache/bcache.h5
-rw-r--r--drivers/md/bcache/bset.c3
-rw-r--r--drivers/md/bcache/btree.c17
-rw-r--r--drivers/md/bcache/debug.c51
-rw-r--r--drivers/md/bcache/debug.h2
-rw-r--r--drivers/md/bcache/sysfs.c3
6 files changed, 0 insertions, 81 deletions
diff --git a/drivers/md/bcache/bcache.h b/drivers/md/bcache/bcache.h
index 4beb55a0ff30..796aef955ce3 100644
--- a/drivers/md/bcache/bcache.h
+++ b/drivers/md/bcache/bcache.h
@@ -628,11 +628,6 @@ struct cache_set {
struct btree *root;
-#ifdef CONFIG_BCACHE_DEBUG
- struct btree *verify_data;
- struct mutex verify_lock;
-#endif
-
unsigned nr_uuids;
struct uuid_entry *uuids;
BKEY_PADDED(uuid_bucket);
diff --git a/drivers/md/bcache/bset.c b/drivers/md/bcache/bset.c
index afec3e029c90..1a60fda4e828 100644
--- a/drivers/md/bcache/bset.c
+++ b/drivers/md/bcache/bset.c
@@ -1042,9 +1042,6 @@ static void __btree_sort(struct btree *b, struct btree_iter *iter,
btree_mergesort(b, out, iter, fixup, remove_stale);
b->nsets = start;
- if (!fixup && !start && b->written)
- bch_btree_verify(b, out);
-
if (!start && order == b->page_order) {
/*
* Our temporary buffer is the same size as the btree node's
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 1ccb702c84d5..3efacbf758cf 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -764,11 +764,6 @@ void bch_btree_cache_free(struct cache_set *c)
mutex_lock(&c->bucket_lock);
-#ifdef CONFIG_BCACHE_DEBUG
- if (c->verify_data)
- list_move(&c->verify_data->list, &c->btree_cache);
-#endif
-
list_splice(&c->btree_cache_freeable,
&c->btree_cache);
@@ -804,18 +799,6 @@ int bch_btree_cache_alloc(struct cache_set *c)
list_splice_init(&c->btree_cache,
&c->btree_cache_freeable);
-#ifdef CONFIG_BCACHE_DEBUG
- mutex_init(&c->verify_lock);
-
- c->verify_data = mca_bucket_alloc(c, &ZERO_KEY, GFP_KERNEL);
-
- if (c->verify_data &&
- c->verify_data->sets[0].data)
- list_del_init(&c->verify_data->list);
- else
- c->verify_data = NULL;
-#endif
-
c->shrink.count_objects = bch_mca_count;
c->shrink.scan_objects = bch_mca_scan;
c->shrink.seeks = 4;
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index fefbe9c93d11..1ed594b08c06 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -118,57 +118,6 @@ static void bch_dump_bucket(struct btree *b)
console_unlock();
}
-void bch_btree_verify(struct btree *b, struct bset *new)
-{
- struct btree *v = b->c->verify_data;
- struct closure cl;
- closure_init_stack(&cl);
-
- if (!b->c->verify)
- return;
-
- closure_wait_event(&b->io.wait, &cl,
- atomic_read(&b->io.cl.remaining) == -1);
-
- mutex_lock(&b->c->verify_lock);
-
- bkey_copy(&v->key, &b->key);
- v->written = 0;
- v->level = b->level;
-
- bch_btree_node_read(v);
- closure_wait_event(&v->io.wait, &cl,
- atomic_read(&b->io.cl.remaining) == -1);
-
- if (new->keys != v->sets[0].data->keys ||
- memcmp(new->start,
- v->sets[0].data->start,
- (void *) end(new) - (void *) new->start)) {
- unsigned i, j;
-
- console_lock();
-
- printk(KERN_ERR "*** original memory node:\n");
- for (i = 0; i <= b->nsets; i++)
- dump_bset(b, b->sets[i].data);
-
- printk(KERN_ERR "*** sorted memory node:\n");
- dump_bset(b, new);
-
- printk(KERN_ERR "*** on disk node:\n");
- dump_bset(v, v->sets[0].data);
-
- for (j = 0; j < new->keys; j++)
- if (new->d[j] != v->sets[0].data->d[j])
- break;
-
- console_unlock();
- panic("verify failed at %u\n", j);
- }
-
- mutex_unlock(&b->c->verify_lock);
-}
-
static void data_verify_endio(struct bio *bio, int error)
{
struct closure *cl = bio->bi_private;
diff --git a/drivers/md/bcache/debug.h b/drivers/md/bcache/debug.h
index 2ede60e31874..8e138a1684aa 100644
--- a/drivers/md/bcache/debug.h
+++ b/drivers/md/bcache/debug.h
@@ -7,7 +7,6 @@ int bch_bkey_to_text(char *buf, size_t size, const struct bkey *k);
#ifdef CONFIG_BCACHE_DEBUG
-void bch_btree_verify(struct btree *, struct bset *);
void bch_data_verify(struct cached_dev *, struct bio *);
int __bch_count_data(struct btree *);
void __bch_check_keys(struct btree *, const char *, ...);
@@ -20,7 +19,6 @@ void bch_btree_iter_next_check(struct btree_iter *);
#else /* DEBUG */
-static inline void bch_btree_verify(struct btree *b, struct bset *i) {}
static inline void bch_data_verify(struct cached_dev *dc, struct bio *bio) {}
static inline int __bch_count_data(struct btree *b) { return -1; }
static inline void __bch_check_keys(struct btree *b, const char *fmt, ...) {}
diff --git a/drivers/md/bcache/sysfs.c b/drivers/md/bcache/sysfs.c
index 80d4c2bee18a..658d855a73d8 100644
--- a/drivers/md/bcache/sysfs.c
+++ b/drivers/md/bcache/sysfs.c
@@ -515,7 +515,6 @@ lock_root:
c->congested_write_threshold_us);
sysfs_print(active_journal_entries, fifo_used(&c->journal.pin));
- sysfs_printf(verify, "%i", c->verify);
sysfs_printf(key_merging_disabled, "%i", c->key_merging_disabled);
sysfs_printf(expensive_debug_checks,
"%i", c->expensive_debug_checks);
@@ -599,7 +598,6 @@ STORE(__bch_cache_set)
c->error_decay = strtoul_or_return(buf) / 88;
sysfs_strtoul(journal_delay_ms, c->journal_delay_ms);
- sysfs_strtoul(verify, c->verify);
sysfs_strtoul(key_merging_disabled, c->key_merging_disabled);
sysfs_strtoul(expensive_debug_checks, c->expensive_debug_checks);
sysfs_strtoul(gc_always_rewrite, c->gc_always_rewrite);
@@ -674,7 +672,6 @@ static struct attribute *bch_cache_set_internal_files[] = {
&sysfs_trigger_gc,
&sysfs_prune_cache,
#ifdef CONFIG_BCACHE_DEBUG
- &sysfs_verify,
&sysfs_key_merging_disabled,
&sysfs_expensive_debug_checks,
#endif