diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-07-24 21:06:22 -0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-11 00:56:30 -0500 |
commit | 6054c6d4da1940c7bf8870c6393773aa794f53d8 (patch) | |
tree | 5851d01503e16884cc733284ae102d27d0fe71ca /drivers/md/bcache/request.c | |
parent | 1b207d80d5b986fb305bc899357435d319319513 (diff) |
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.c | 10 |
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) | |||
218 | struct search *s = container_of(cl, struct search, btree); | 218 | struct search *s = container_of(cl, struct search, btree); |
219 | atomic_t *journal_ref = NULL; | 219 | atomic_t *journal_ref = NULL; |
220 | struct bkey *replace_key = s->replace ? &s->replace_key : NULL; | 220 | struct bkey *replace_key = s->replace ? &s->replace_key : NULL; |
221 | int ret; | ||
221 | 222 | ||
222 | /* | 223 | /* |
223 | * If we're looping, might already be waiting on | 224 | * If we're looping, might already be waiting on |
@@ -236,8 +237,11 @@ static void bch_data_insert_keys(struct closure *cl) | |||
236 | s->flush_journal | 237 | s->flush_journal |
237 | ? &s->cl : NULL); | 238 | ? &s->cl : NULL); |
238 | 239 | ||
239 | if (bch_btree_insert(&s->op, s->c, &s->insert_keys, | 240 | ret = bch_btree_insert(&s->op, s->c, &s->insert_keys, |
240 | journal_ref, replace_key)) { | 241 | journal_ref, replace_key); |
242 | if (ret == -ESRCH) { | ||
243 | s->insert_collision = true; | ||
244 | } else if (ret) { | ||
241 | s->error = -ENOMEM; | 245 | s->error = -ENOMEM; |
242 | s->insert_data_done = true; | 246 | s->insert_data_done = true; |
243 | } | 247 | } |
@@ -977,7 +981,7 @@ static void cached_dev_cache_miss_done(struct closure *cl) | |||
977 | { | 981 | { |
978 | struct search *s = container_of(cl, struct search, cl); | 982 | struct search *s = container_of(cl, struct search, cl); |
979 | 983 | ||
980 | if (s->op.insert_collision) | 984 | if (s->insert_collision) |
981 | bch_mark_cache_miss_collision(s); | 985 | bch_mark_cache_miss_collision(s); |
982 | 986 | ||
983 | if (s->cache_bio) { | 987 | if (s->cache_bio) { |