diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-09-11 05:52:54 +0400 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-11 09:56:29 +0400 |
commit | 1b207d80d5b986fb305bc899357435d319319513 (patch) | |
tree | bf75b0befff3f48606832df0a64ced1c3c3ae91d /drivers/md/bcache/request.c | |
parent | faadf0c96547ec8277ad0abd6959f2ef48522f31 (diff) | |
download | linux-1b207d80d5b986fb305bc899357435d319319513.tar.xz |
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) { struct search *s = container_of(cl, struct search, btree); atomic_t *journal_ref = NULL; + struct bkey *replace_key = s->replace ? &s->replace_key : NULL; /* * If we're looping, might already be waiting on @@ -235,7 +236,8 @@ 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)) { + if (bch_btree_insert(&s->op, s->c, &s->insert_keys, + journal_ref, replace_key)) { s->error = -ENOMEM; s->insert_data_done = true; } @@ -1056,7 +1058,7 @@ static void cached_dev_read_done(struct closure *cl) if (s->cache_bio && !test_bit(CACHE_SET_STOPPING, &s->c->flags)) { - s->op.type = BTREE_REPLACE; + BUG_ON(!s->replace); closure_call(&s->btree, bch_data_insert, NULL, cl); } @@ -1101,13 +1103,15 @@ static int cached_dev_cache_miss(struct btree *b, struct search *s, s->cache_bio_sectors = min(sectors, bio_sectors(bio) + reada); - s->op.replace = KEY(s->inode, bio->bi_sector + - s->cache_bio_sectors, s->cache_bio_sectors); + s->replace_key = KEY(s->inode, bio->bi_sector + + s->cache_bio_sectors, s->cache_bio_sectors); - ret = bch_btree_insert_check_key(b, &s->op, &s->op.replace); + ret = bch_btree_insert_check_key(b, &s->op, &s->replace_key); if (ret) return ret; + s->replace = true; + miss = bch_bio_split(bio, sectors, GFP_NOIO, s->d->bio_split); /* btree_search_recurse()'s btree iterator is no good anymore */ |