aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/debug.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-12-20 20:28:16 -0500
committerKent Overstreet <kmo@daterainc.com>2014-01-08 16:05:13 -0500
commita85e968e66a175c86d0410719ea84a5bd0f1d070 (patch)
tree83bd657e47b22862380db37af3051d81c1f4e74b /drivers/md/bcache/debug.c
parent65d45231b56efb3db51eb441e2c68f8252ecdd12 (diff)
bcache: Add struct btree_keys
Soon, bset.c won't need to depend on struct btree. Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/debug.c')
-rw-r--r--drivers/md/bcache/debug.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/drivers/md/bcache/debug.c b/drivers/md/bcache/debug.c
index 2c6587d016db..8acc18af07c1 100644
--- a/drivers/md/bcache/debug.c
+++ b/drivers/md/bcache/debug.c
@@ -113,9 +113,9 @@ static void bch_dump_bucket(struct btree *b)
113 unsigned i; 113 unsigned i;
114 114
115 console_lock(); 115 console_lock();
116 for (i = 0; i <= b->nsets; i++) 116 for (i = 0; i <= b->keys.nsets; i++)
117 dump_bset(b, b->sets[i].data, 117 dump_bset(b, b->keys.set[i].data,
118 bset_block_offset(b, b->sets[i].data)); 118 bset_block_offset(b, b->keys.set[i].data));
119 console_unlock(); 119 console_unlock();
120} 120}
121 121
@@ -139,13 +139,13 @@ void bch_btree_verify(struct btree *b)
139 mutex_lock(&b->c->verify_lock); 139 mutex_lock(&b->c->verify_lock);
140 140
141 ondisk = b->c->verify_ondisk; 141 ondisk = b->c->verify_ondisk;
142 sorted = b->c->verify_data->sets->data; 142 sorted = b->c->verify_data->keys.set->data;
143 inmemory = b->sets->data; 143 inmemory = b->keys.set->data;
144 144
145 bkey_copy(&v->key, &b->key); 145 bkey_copy(&v->key, &b->key);
146 v->written = 0; 146 v->written = 0;
147 v->level = b->level; 147 v->level = b->level;
148 v->ops = b->ops; 148 v->keys.ops = b->keys.ops;
149 149
150 bio = bch_bbio_alloc(b->c); 150 bio = bch_bbio_alloc(b->c);
151 bio->bi_bdev = PTR_CACHE(b->c, &b->key, 0)->bdev; 151 bio->bi_bdev = PTR_CACHE(b->c, &b->key, 0)->bdev;
@@ -159,7 +159,7 @@ void bch_btree_verify(struct btree *b)
159 memcpy(ondisk, sorted, KEY_SIZE(&v->key) << 9); 159 memcpy(ondisk, sorted, KEY_SIZE(&v->key) << 9);
160 160
161 bch_btree_node_read_done(v); 161 bch_btree_node_read_done(v);
162 sorted = v->sets->data; 162 sorted = v->keys.set->data;
163 163
164 if (inmemory->keys != sorted->keys || 164 if (inmemory->keys != sorted->keys ||
165 memcmp(inmemory->start, 165 memcmp(inmemory->start,
@@ -264,14 +264,14 @@ void __bch_check_keys(struct btree *b, const char *fmt, ...)
264 if (p && bkey_cmp(&START_KEY(p), &START_KEY(k)) > 0) 264 if (p && bkey_cmp(&START_KEY(p), &START_KEY(k)) > 0)
265 goto bug; 265 goto bug;
266 266
267 if (bch_ptr_invalid(b, k)) 267 if (bch_ptr_invalid(&b->keys, k))
268 continue; 268 continue;
269 269
270 err = "Overlapping keys"; 270 err = "Overlapping keys";
271 if (p && bkey_cmp(p, &START_KEY(k)) > 0) 271 if (p && bkey_cmp(p, &START_KEY(k)) > 0)
272 goto bug; 272 goto bug;
273 } else { 273 } else {
274 if (bch_ptr_bad(b, k)) 274 if (bch_ptr_bad(&b->keys, k))
275 continue; 275 continue;
276 276
277 err = "Duplicate keys"; 277 err = "Duplicate keys";