diff options
author | Kent Overstreet <kent.overstreet@gmail.com> | 2015-08-31 10:50:21 -0800 |
---|---|---|
committer | Kent Overstreet <kent.overstreet@gmail.com> | 2018-01-30 20:40:32 -0500 |
commit | a58b7c20358e229384526f4dd991f057d7ad160a (patch) | |
tree | 7c1392a1ffd8ef798b6dedaba997a353f5fdffd4 | |
parent | ba6275389199717070a3862b69d1337f4462f1ec (diff) |
Revert "bcache: don't embed 'return' statements in closure macros"
This reverts commit 77b5a08427e87514c33730afc18cd02c9475e2c3 - the patch was
never mailed out to any mailing lists or the maintainer.
Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
-rw-r--r-- | drivers/md/bcache/closure.h | 3 | ||||
-rw-r--r-- | drivers/md/bcache/journal.c | 2 | ||||
-rw-r--r-- | drivers/md/bcache/request.c | 30 |
3 files changed, 18 insertions, 17 deletions
diff --git a/drivers/md/bcache/closure.h b/drivers/md/bcache/closure.h index ccfbea6f9f6b..7ff11a2b6819 100644 --- a/drivers/md/bcache/closure.h +++ b/drivers/md/bcache/closure.h @@ -327,6 +327,7 @@ static inline void closure_wake_up(struct closure_waitlist *list) do { \ set_closure_fn(_cl, _fn, _wq); \ closure_sub(_cl, CLOSURE_RUNNING + 1); \ + return; \ } while (0) /** @@ -353,6 +354,7 @@ do { \ do { \ set_closure_fn(_cl, _fn, _wq); \ closure_queue(_cl); \ + return; \ } while (0) /** @@ -368,6 +370,7 @@ do { \ do { \ set_closure_fn(_cl, _destructor, NULL); \ closure_sub(_cl, CLOSURE_RUNNING - CLOSURE_DESTRUCTOR + 1); \ + return; \ } while (0) /** diff --git a/drivers/md/bcache/journal.c b/drivers/md/bcache/journal.c index a87165c1d8e5..981eeb5561ea 100644 --- a/drivers/md/bcache/journal.c +++ b/drivers/md/bcache/journal.c @@ -596,14 +596,12 @@ static void journal_write_unlocked(struct closure *cl) if (!w->need_write) { closure_return_with_destructor(cl, journal_write_unlock); - return; } else if (journal_full(&c->journal)) { journal_reclaim(c); spin_unlock(&c->journal.lock); btree_flush_write(c); continue_at(cl, journal_write, system_wq); - return; } c->journal.blocks_free -= set_blocks(w->data, block_bytes(c)); diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 643c3021624f..e4bcc8500703 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -89,10 +89,8 @@ static void bch_data_insert_keys(struct closure *cl) if (journal_ref) atomic_dec_bug(journal_ref); - if (!op->insert_data_done) { + if (!op->insert_data_done) continue_at(cl, bch_data_insert_start, op->wq); - return; - } bch_keylist_free(&op->insert_keys); closure_return(cl); @@ -217,10 +215,8 @@ static void bch_data_insert_start(struct closure *cl) /* 1 for the device pointer and 1 for the chksum */ if (bch_keylist_realloc(&op->insert_keys, 3 + (op->csum ? 1 : 0), - op->c)) { + op->c)) continue_at(cl, bch_data_insert_keys, op->wq); - return; - } k = op->insert_keys.top; bkey_init(k); @@ -258,7 +254,6 @@ static void bch_data_insert_start(struct closure *cl) op->insert_data_done = true; continue_at(cl, bch_data_insert_keys, op->wq); - return; err: /* bch_alloc_sectors() blocks if s->writeback = true */ BUG_ON(op->writeback); @@ -583,10 +578,8 @@ static void cache_lookup(struct closure *cl) ret = bch_btree_map_keys(&s->op, s->iop.c, &KEY(s->iop.inode, bio->bi_iter.bi_sector, 0), cache_lookup_fn, MAP_END_KEY); - if (ret == -EAGAIN) { + if (ret == -EAGAIN) continue_at(cl, cache_lookup, bcache_wq); - return; - } closure_return(cl); } @@ -966,8 +959,7 @@ static void cached_dev_nodata(struct closure *cl) /* Cached devices - read & write stuff */ -static blk_qc_t cached_dev_make_request(struct request_queue *q, - struct bio *bio) +static void __cached_dev_make_request(struct request_queue *q, struct bio *bio) { struct search *s; struct bcache_device *d = bio->bi_disk->private_data; @@ -1006,7 +998,12 @@ static blk_qc_t cached_dev_make_request(struct request_queue *q, else generic_make_request(bio); } +} +static blk_qc_t cached_dev_make_request(struct request_queue *q, + struct bio *bio) +{ + __cached_dev_make_request(q, bio); return BLK_QC_T_NONE; } @@ -1081,8 +1078,7 @@ static void flash_dev_nodata(struct closure *cl) continue_at(cl, search_free, NULL); } -static blk_qc_t flash_dev_make_request(struct request_queue *q, - struct bio *bio) +static void __flash_dev_make_request(struct request_queue *q, struct bio *bio) { struct search *s; struct closure *cl; @@ -1105,7 +1101,6 @@ static blk_qc_t flash_dev_make_request(struct request_queue *q, continue_at_nobarrier(&s->cl, flash_dev_nodata, bcache_wq); - return BLK_QC_T_NONE; } else if (rw) { bch_keybuf_check_overlapping(&s->iop.c->moving_gc_keys, &KEY(d->id, bio->bi_iter.bi_sector, 0), @@ -1121,6 +1116,11 @@ static blk_qc_t flash_dev_make_request(struct request_queue *q, } continue_at(cl, search_free, NULL); +} + +static blk_qc_t flash_dev_make_request(struct request_queue *q, struct bio *bio) +{ + __flash_dev_make_request(q, bio); return BLK_QC_T_NONE; } |