summaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorKent Overstreet <kmo@daterainc.com>2013-11-23 18:19:27 -0800
committerKent Overstreet <kmo@daterainc.com>2013-11-23 22:33:54 -0800
commit59d276fe02d7e887a4825ef05c80b8f8c54ba60a (patch)
treedbb8c78a922d47652c08d9f5e46d77708ac95543 /drivers/md
parentbdb53207411ae39b8a80dda0a66d1b468cbe1380 (diff)
downloadlinux-59d276fe02d7e887a4825ef05c80b8f8c54ba60a.tar.gz
linux-59d276fe02d7e887a4825ef05c80b8f8c54ba60a.tar.bz2
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/md')
-rw-r--r--drivers/md/bcache/request.c8
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);
}