diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-07-25 03:06:22 +0200 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-11 06:56:30 +0100 |
commit | 6054c6d4da1940c7bf8870c6393773aa794f53d8 (patch) | |
tree | 5851d01503e16884cc733284ae102d27d0fe71ca /drivers/md/bcache/writeback.c | |
parent | bcache: Kill op->replace (diff) | |
download | linux-6054c6d4da1940c7bf8870c6393773aa794f53d8.tar.xz linux-6054c6d4da1940c7bf8870c6393773aa794f53d8.zip |
bcache: Don't use op->insert_collision
When we convert bch_btree_insert() to bch_btree_map_leaf_nodes(), we
won't be passing struct btree_op to bch_btree_insert() anymore - so we
need a different way of returning whether there was a collision (really,
a replace collision).
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/writeback.c')
-rw-r--r-- | drivers/md/bcache/writeback.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/md/bcache/writeback.c b/drivers/md/bcache/writeback.c index 346a5341faca..312032ef34f7 100644 --- a/drivers/md/bcache/writeback.c +++ b/drivers/md/bcache/writeback.c @@ -142,6 +142,7 @@ static void write_dirty_finish(struct closure *cl) unsigned i; struct btree_op op; struct keylist keys; + int ret; bch_btree_op_init(&op, -1); bch_keylist_init(&keys); @@ -153,12 +154,12 @@ static void write_dirty_finish(struct closure *cl) for (i = 0; i < KEY_PTRS(&w->key); i++) atomic_inc(&PTR_BUCKET(dc->disk.c, &w->key, i)->pin); - bch_btree_insert(&op, dc->disk.c, &keys, NULL, &w->key); + ret = bch_btree_insert(&op, dc->disk.c, &keys, NULL, &w->key); - if (op.insert_collision) + if (ret) trace_bcache_writeback_collision(&w->key); - atomic_long_inc(op.insert_collision + atomic_long_inc(ret ? &dc->disk.c->writeback_keys_failed : &dc->disk.c->writeback_keys_done); } |