diff options
author | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 03:19:27 +0100 |
---|---|---|
committer | Kent Overstreet <kmo@daterainc.com> | 2013-11-24 07:33:54 +0100 |
commit | 59d276fe02d7e887a4825ef05c80b8f8c54ba60a (patch) | |
tree | dbb8c78a922d47652c08d9f5e46d77708ac95543 /drivers | |
parent | block: Refactor bio_clone_bioset() for immutable biovecs (diff) | |
download | linux-59d276fe02d7e887a4825ef05c80b8f8c54ba60a.tar.xz linux-59d276fe02d7e887a4825ef05c80b8f8c54ba60a.zip |
block: Add bio_clone_fast()
bio_clone() just got more expensive - however, most users of bio_clone()
don't actually need to modify the biovec. If they aren't modifying the
biovec, and they can guarantee that the original bio isn't freed before
the clone (also true in most cases), we can just point the clone at the
original bio's biovec.
Signed-off-by: Kent Overstreet <kmo@daterainc.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/bcache/request.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/md/bcache/request.c b/drivers/md/bcache/request.c index 4c0a422fd49f..63451c724781 100644 --- a/drivers/md/bcache/request.c +++ b/drivers/md/bcache/request.c @@ -613,7 +613,6 @@ struct search { struct btree_op op; struct data_insert_op iop; - struct bio_vec bv[BIO_MAX_PAGES]; }; static void bch_cache_read_endio(struct bio *bio, int error) @@ -761,9 +760,7 @@ static void do_bio_hook(struct search *s) struct bio *bio = &s->bio.bio; bio_init(bio); - bio->bi_io_vec = s->bv; - bio->bi_max_vecs = BIO_MAX_PAGES; - __bio_clone(bio, s->orig_bio); + __bio_clone_fast(bio, s->orig_bio); bio->bi_end_io = request_endio; bio->bi_private = &s->cl; @@ -1065,8 +1062,7 @@ static void cached_dev_write(struct cached_dev *dc, struct search *s) closure_bio_submit(flush, cl, s->d); } } else { - s->iop.bio = bio_clone_bioset(bio, GFP_NOIO, - dc->disk.bio_split); + s->iop.bio = bio_clone_fast(bio, GFP_NOIO, dc->disk.bio_split); closure_bio_submit(bio, cl, s->d); } |