aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/btree.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/md/bcache/btree.c')
-rw-r--r--drivers/md/bcache/btree.c21
1 files changed, 6 insertions, 15 deletions
diff --git a/drivers/md/bcache/btree.c b/drivers/md/bcache/btree.c
index 218d486259a3..53a0f4ef4e32 100644
--- a/drivers/md/bcache/btree.c
+++ b/drivers/md/bcache/btree.c
@@ -1770,7 +1770,7 @@ static bool btree_insert_key(struct btree *b, struct btree_op *op,
1770{ 1770{
1771 struct bset *i = b->sets[b->nsets].data; 1771 struct bset *i = b->sets[b->nsets].data;
1772 struct bkey *m, *prev; 1772 struct bkey *m, *prev;
1773 const char *status = "insert"; 1773 unsigned status = BTREE_INSERT_STATUS_INSERT;
1774 1774
1775 BUG_ON(bkey_cmp(k, &b->key) > 0); 1775 BUG_ON(bkey_cmp(k, &b->key) > 0);
1776 BUG_ON(b->level && !KEY_PTRS(k)); 1776 BUG_ON(b->level && !KEY_PTRS(k));
@@ -1803,17 +1803,17 @@ static bool btree_insert_key(struct btree *b, struct btree_op *op,
1803 goto insert; 1803 goto insert;
1804 1804
1805 /* prev is in the tree, if we merge we're done */ 1805 /* prev is in the tree, if we merge we're done */
1806 status = "back merging"; 1806 status = BTREE_INSERT_STATUS_BACK_MERGE;
1807 if (prev && 1807 if (prev &&
1808 bch_bkey_try_merge(b, prev, k)) 1808 bch_bkey_try_merge(b, prev, k))
1809 goto merged; 1809 goto merged;
1810 1810
1811 status = "overwrote front"; 1811 status = BTREE_INSERT_STATUS_OVERWROTE;
1812 if (m != end(i) && 1812 if (m != end(i) &&
1813 KEY_PTRS(m) == KEY_PTRS(k) && !KEY_SIZE(m)) 1813 KEY_PTRS(m) == KEY_PTRS(k) && !KEY_SIZE(m))
1814 goto copy; 1814 goto copy;
1815 1815
1816 status = "front merge"; 1816 status = BTREE_INSERT_STATUS_FRONT_MERGE;
1817 if (m != end(i) && 1817 if (m != end(i) &&
1818 bch_bkey_try_merge(b, k, m)) 1818 bch_bkey_try_merge(b, k, m))
1819 goto copy; 1819 goto copy;
@@ -1823,16 +1823,12 @@ static bool btree_insert_key(struct btree *b, struct btree_op *op,
1823insert: shift_keys(b, m, k); 1823insert: shift_keys(b, m, k);
1824copy: bkey_copy(m, k); 1824copy: bkey_copy(m, k);
1825merged: 1825merged:
1826 bch_check_keys(b, "%s for %s at %s: %s", status, 1826 bch_check_keys(b, "%u for %s", status, op_type(op));
1827 op_type(op), pbtree(b), pkey(k));
1828 bch_check_key_order_msg(b, i, "%s for %s at %s: %s", status,
1829 op_type(op), pbtree(b), pkey(k));
1830 1827
1831 if (b->level && !KEY_OFFSET(k)) 1828 if (b->level && !KEY_OFFSET(k))
1832 btree_current_write(b)->prio_blocked++; 1829 btree_current_write(b)->prio_blocked++;
1833 1830
1834 pr_debug("%s for %s at %s: %s", status, 1831 trace_bcache_btree_insert_key(b, k, op->type, status);
1835 op_type(op), pbtree(b), pkey(k));
1836 1832
1837 return true; 1833 return true;
1838} 1834}
@@ -2234,9 +2230,6 @@ int bch_btree_search_recurse(struct btree *b, struct btree_op *op)
2234 struct btree_iter iter; 2230 struct btree_iter iter;
2235 bch_btree_iter_init(b, &iter, &KEY(op->inode, bio->bi_sector, 0)); 2231 bch_btree_iter_init(b, &iter, &KEY(op->inode, bio->bi_sector, 0));
2236 2232
2237 pr_debug("at %s searching for %u:%llu", pbtree(b), op->inode,
2238 (uint64_t) bio->bi_sector);
2239
2240 do { 2233 do {
2241 k = bch_btree_iter_next_filter(&iter, b, bch_ptr_bad); 2234 k = bch_btree_iter_next_filter(&iter, b, bch_ptr_bad);
2242 if (!k) { 2235 if (!k) {
@@ -2302,8 +2295,6 @@ static int bch_btree_refill_keybuf(struct btree *b, struct btree_op *op,
2302 if (buf->key_predicate(buf, k)) { 2295 if (buf->key_predicate(buf, k)) {
2303 struct keybuf_key *w; 2296 struct keybuf_key *w;
2304 2297
2305 pr_debug("%s", pkey(k));
2306
2307 spin_lock(&buf->lock); 2298 spin_lock(&buf->lock);
2308 2299
2309 w = array_alloc(&buf->freelist); 2300 w = array_alloc(&buf->freelist);