aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/bio.c11
-rw-r--r--fs/exofs/ore.c5
2 files changed, 9 insertions, 7 deletions
diff --git a/fs/bio.c b/fs/bio.c
index 191b9b86c27..13e956779e1 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -438,16 +438,19 @@ void __bio_clone(struct bio *bio, struct bio *bio_src)
438EXPORT_SYMBOL(__bio_clone); 438EXPORT_SYMBOL(__bio_clone);
439 439
440/** 440/**
441 * bio_clone - clone a bio 441 * bio_clone_bioset - clone a bio
442 * @bio: bio to clone 442 * @bio: bio to clone
443 * @gfp_mask: allocation priority 443 * @gfp_mask: allocation priority
444 * @bs: bio_set to allocate from
444 * 445 *
445 * Like __bio_clone, only also allocates the returned bio 446 * Like __bio_clone, only also allocates the returned bio
446 */ 447 */
447struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask) 448struct bio *bio_clone_bioset(struct bio *bio, gfp_t gfp_mask,
449 struct bio_set *bs)
448{ 450{
449 struct bio *b = bio_alloc(gfp_mask, bio->bi_max_vecs); 451 struct bio *b;
450 452
453 b = bio_alloc_bioset(gfp_mask, bio->bi_max_vecs, bs);
451 if (!b) 454 if (!b)
452 return NULL; 455 return NULL;
453 456
@@ -466,7 +469,7 @@ struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask)
466 469
467 return b; 470 return b;
468} 471}
469EXPORT_SYMBOL(bio_clone); 472EXPORT_SYMBOL(bio_clone_bioset);
470 473
471/** 474/**
472 * bio_get_nr_vecs - return approx number of vecs 475 * bio_get_nr_vecs - return approx number of vecs
diff --git a/fs/exofs/ore.c b/fs/exofs/ore.c
index 1585db1aa36..f936cb50dc0 100644
--- a/fs/exofs/ore.c
+++ b/fs/exofs/ore.c
@@ -814,8 +814,8 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
814 struct bio *bio; 814 struct bio *bio;
815 815
816 if (per_dev != master_dev) { 816 if (per_dev != master_dev) {
817 bio = bio_kmalloc(GFP_KERNEL, 817 bio = bio_clone_kmalloc(master_dev->bio,
818 master_dev->bio->bi_max_vecs); 818 GFP_KERNEL);
819 if (unlikely(!bio)) { 819 if (unlikely(!bio)) {
820 ORE_DBGMSG( 820 ORE_DBGMSG(
821 "Failed to allocate BIO size=%u\n", 821 "Failed to allocate BIO size=%u\n",
@@ -824,7 +824,6 @@ static int _write_mirror(struct ore_io_state *ios, int cur_comp)
824 goto out; 824 goto out;
825 } 825 }
826 826
827 __bio_clone(bio, master_dev->bio);
828 bio->bi_bdev = NULL; 827 bio->bi_bdev = NULL;
829 bio->bi_next = NULL; 828 bio->bi_next = NULL;
830 per_dev->offset = master_dev->offset; 829 per_dev->offset = master_dev->offset;