diff options
author | Kent Overstreet <koverstreet@google.com> | 2012-09-06 18:35:02 -0400 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2012-09-09 04:35:39 -0400 |
commit | bf800ef1816b4283a885e55ad38068aec9711e4d (patch) | |
tree | c99cbe70b68ede65b478b3006a7ed7e34b453f3d /block | |
parent | 3f86a82aeb03e6100f7ab39f4702e033a5e38166 (diff) |
block: Add bio_clone_bioset(), bio_clone_kmalloc()
Previously, there was bio_clone() but it only allocated from the fs bio
set; as a result various users were open coding it and using
__bio_clone().
This changes bio_clone() to become bio_clone_bioset(), and then we add
bio_clone() and bio_clone_kmalloc() as wrappers around it, making use of
the functionality the last patch adedd.
This will also help in a later patch changing how bio cloning works.
Signed-off-by: Kent Overstreet <koverstreet@google.com>
CC: Jens Axboe <axboe@kernel.dk>
CC: NeilBrown <neilb@suse.de>
CC: Alasdair Kergon <agk@redhat.com>
CC: Boaz Harrosh <bharrosh@panasas.com>
CC: Jeff Garzik <jeff@garzik.org>
Acked-by: Jeff Garzik <jgarzik@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'block')
-rw-r--r-- | block/blk-core.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/block/blk-core.c b/block/blk-core.c index b776cc90a4e7..82aab2815858 100644 --- a/block/blk-core.c +++ b/block/blk-core.c | |||
@@ -2781,16 +2781,10 @@ int blk_rq_prep_clone(struct request *rq, struct request *rq_src, | |||
2781 | blk_rq_init(NULL, rq); | 2781 | blk_rq_init(NULL, rq); |
2782 | 2782 | ||
2783 | __rq_for_each_bio(bio_src, rq_src) { | 2783 | __rq_for_each_bio(bio_src, rq_src) { |
2784 | bio = bio_alloc_bioset(gfp_mask, bio_src->bi_max_vecs, bs); | 2784 | bio = bio_clone_bioset(bio_src, gfp_mask, bs); |
2785 | if (!bio) | 2785 | if (!bio) |
2786 | goto free_and_out; | 2786 | goto free_and_out; |
2787 | 2787 | ||
2788 | __bio_clone(bio, bio_src); | ||
2789 | |||
2790 | if (bio_integrity(bio_src) && | ||
2791 | bio_integrity_clone(bio, bio_src, gfp_mask)) | ||
2792 | goto free_and_out; | ||
2793 | |||
2794 | if (bio_ctr && bio_ctr(bio, bio_src, data)) | 2788 | if (bio_ctr && bio_ctr(bio, bio_src, data)) |
2795 | goto free_and_out; | 2789 | goto free_and_out; |
2796 | 2790 | ||