summaryrefslogtreecommitdiffstats
path: root/drivers/md/bcache/request.c
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-07-24 18:06:22 -0700
committerKent Overstreet <kmo@daterainc.com>2013-11-10 21:56:30 -0800
commit6054c6d4da1940c7bf8870c6393773aa794f53d8 (patch)
tree5851d01503e16884cc733284ae102d27d0fe71ca /drivers/md/bcache/request.c
parent1b207d80d5b986fb305bc899357435d319319513 (diff)
downloadblackbird-op-linux-6054c6d4da1940c7bf8870c6393773aa794f53d8.tar.gz
blackbird-op-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/request.c')
-rw-r--r--drivers/md/bcache/request.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c
index 16a3e16f3ff4..bcce06a1e466 100644
--- a/drivers/md/bcache/request.c
+++ b/drivers/md/bcache/request.c
@@ -218,6 +218,7 @@ static void bch_data_insert_keys(struct closure *cl)
struct search *s = container_of(cl, struct search, btree);
atomic_t *journal_ref = NULL;
struct bkey *replace_key = s->replace ? &s->replace_key : NULL;
+ int ret;
/*
* If we're looping, might already be waiting on
@@ -236,8 +237,11 @@ static void bch_data_insert_keys(struct closure *cl)
s->flush_journal
? &s->cl : NULL);
- if (bch_btree_insert(&s->op, s->c, &s->insert_keys,
- journal_ref, replace_key)) {
+ ret = bch_btree_insert(&s->op, s->c, &s->insert_keys,
+ journal_ref, replace_key);
+ if (ret == -ESRCH) {
+ s->insert_collision = true;
+ } else if (ret) {
s->error = -ENOMEM;
s->insert_data_done = true;
}
@@ -977,7 +981,7 @@ static void cached_dev_cache_miss_done(struct closure *cl)
{
struct search *s = container_of(cl, struct search, cl);
- if (s->op.insert_collision)
+ if (s->insert_collision)
bch_mark_cache_miss_collision(s);
if (s->cache_bio) {
OpenPOWER on IntegriCloud