aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-03-14 16:43:18 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-03-14 16:43:18 -0400
commit18553c38bcdef9b0cc69a784cd033a8a21bfa012 (patch)
tree03b2b4f92a5ccb3416adb69196248751e3a1d0c2 /fs
parent326d8519fc97be186c55ac605c3a7c957c758ae1 (diff)
parentbfbd442f69ec9c58590ffc6e93ac8d6809caa48b (diff)
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
* 'for-linus' of git://git.kernel.dk/linux-2.6-block: Fix Xilinx SystemACE driver to handle empty CF slot block: fix memory leak in bio_clone() block: Add gfp_mask parameter to bio_integrity_clone()
Diffstat (limited to 'fs')
-rw-r--r--fs/bio-integrity.c5
-rw-r--r--fs/bio.c6
2 files changed, 7 insertions, 4 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 549b0144da11..fe2b1aa2464e 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -685,19 +685,20 @@ EXPORT_SYMBOL(bio_integrity_split);
685 * bio_integrity_clone - Callback for cloning bios with integrity metadata 685 * bio_integrity_clone - Callback for cloning bios with integrity metadata
686 * @bio: New bio 686 * @bio: New bio
687 * @bio_src: Original bio 687 * @bio_src: Original bio
688 * @gfp_mask: Memory allocation mask
688 * @bs: bio_set to allocate bip from 689 * @bs: bio_set to allocate bip from
689 * 690 *
690 * Description: Called to allocate a bip when cloning a bio 691 * Description: Called to allocate a bip when cloning a bio
691 */ 692 */
692int bio_integrity_clone(struct bio *bio, struct bio *bio_src, 693int bio_integrity_clone(struct bio *bio, struct bio *bio_src,
693 struct bio_set *bs) 694 gfp_t gfp_mask, struct bio_set *bs)
694{ 695{
695 struct bio_integrity_payload *bip_src = bio_src->bi_integrity; 696 struct bio_integrity_payload *bip_src = bio_src->bi_integrity;
696 struct bio_integrity_payload *bip; 697 struct bio_integrity_payload *bip;
697 698
698 BUG_ON(bip_src == NULL); 699 BUG_ON(bip_src == NULL);
699 700
700 bip = bio_integrity_alloc_bioset(bio, GFP_NOIO, bip_src->bip_vcnt, bs); 701 bip = bio_integrity_alloc_bioset(bio, gfp_mask, bip_src->bip_vcnt, bs);
701 702
702 if (bip == NULL) 703 if (bip == NULL)
703 return -EIO; 704 return -EIO;
diff --git a/fs/bio.c b/fs/bio.c
index 124b95c4d582..d4f06327c810 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -463,10 +463,12 @@ struct bio *bio_clone(struct bio *bio, gfp_t gfp_mask)
463 if (bio_integrity(bio)) { 463 if (bio_integrity(bio)) {
464 int ret; 464 int ret;
465 465
466 ret = bio_integrity_clone(b, bio, fs_bio_set); 466 ret = bio_integrity_clone(b, bio, gfp_mask, fs_bio_set);
467 467
468 if (ret < 0) 468 if (ret < 0) {
469 bio_put(b);
469 return NULL; 470 return NULL;
471 }
470 } 472 }
471 473
472 return b; 474 return b;