diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-09-10 21:52:54 -0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-11 00:56:29 -0500 |
commit | 1b207d80d5b986fb305bc899357435d319319513 (patch) | |
tree | bf75b0befff3f48606832df0a64ced1c3c3ae91d /drivers/md/bcache/request.c | |
parent | faadf0c96547ec8277ad0abd6959f2ef48522f31 (diff) |
bcache: Kill op->replace
This is prep work for converting bch_btree_insert to
bch_btree_map_leaf_nodes() - we have to convert all its arguments to
actual arguments. Bunch of churn, but should be straightforward.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers/md/bcache/request.c')
-rw-r--r-- | drivers/md/bcache/request.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 5df44fbc9e1d..16a3e16f3ff4 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c | |||
@@ -217,6 +217,7 @@ static void bch_data_insert_keys(struct closure *cl) | |||
217 | { | 217 | { |
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 | 221 | ||
221 | /* | 222 | /* |
222 | * If we're looping, might already be waiting on | 223 | * If we're looping, might already be waiting on |
@@ -235,7 +236,8 @@ static void bch_data_insert_keys(struct closure *cl) | |||
235 | s->flush_journal | 236 | s->flush_journal |
236 | ? &s->cl : NULL); | 237 | ? &s->cl : NULL); |
237 | 238 | ||
238 | if (bch_btree_insert(&s->op, s->c, &s->insert_keys, journal_ref)) { | 239 | if (bch_btree_insert(&s->op, s->c, &s->insert_keys, |
240 | journal_ref, replace_key)) { | ||
239 | s->error = -ENOMEM; | 241 | s->error = -ENOMEM; |
240 | s->insert_data_done = true; | 242 | s->insert_data_done = true; |
241 | } | 243 | } |
@@ -1056,7 +1058,7 @@ static void cached_dev_read_done(struct closure *cl) | |||
1056 | 1058 | ||
1057 | if (s->cache_bio && | 1059 | if (s->cache_bio && |
1058 | !test_bit(CACHE_SET_STOPPING, &s->c->flags)) { | 1060 | !test_bit(CACHE_SET_STOPPING, &s->c->flags)) { |
1059 | s->op.type = BTREE_REPLACE; | 1061 | BUG_ON(!s->replace); |
1060 | closure_call(&s->btree, bch_data_insert, NULL, cl); | 1062 | closure_call(&s->btree, bch_data_insert, NULL, cl); |
1061 | } | 1063 | } |
1062 | 1064 | ||
@@ -1101,13 +1103,15 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s, | |||
1101 | 1103 | ||
1102 | s->cache_bio_sectors = min(sectors, bio_sectors(bio) + reada); | 1104 | s->cache_bio_sectors = min(sectors, bio_sectors(bio) + reada); |
1103 | 1105 | ||
1104 | s->op.replace = KEY(s->inode, bio->bi_sector + | 1106 | s->replace_key = KEY(s->inode, bio->bi_sector + |
1105 | s->cache_bio_sectors, s->cache_bio_sectors); | 1107 | s->cache_bio_sectors, s->cache_bio_sectors); |
1106 | 1108 | ||
1107 | ret = bch_btree_insert_check_key(b, &s->op, &s->op.replace); | 1109 | ret = bch_btree_insert_check_key(b, &s->op, &s->replace_key); |
1108 | if (ret) | 1110 | if (ret) |
1109 | return ret; | 1111 | return ret; |
1110 | 1112 | ||
1113 | s->replace = true; | ||
1114 | |||
1111 | miss = bch_bio_split(bio, sectors, GFP_NOIO, s->d->bio_split); | 1115 | miss = bch_bio_split(bio, sectors, GFP_NOIO, s->d->bio_split); |
1112 | 1116 | ||
1113 | /* btree_search_recurse()'s btree iterator is no good anymore */ | 1117 | /* btree_search_recurse()'s btree iterator is no good anymore */ |