summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorMartin K. Petersen <martin.petersen@oracle.com>2008-10-01 11:38:37 +0400
committerJens Axboe <jens.axboe@oracle.com>2008-10-09 10:56:21 +0400
commit74aa8c2cc010035a7eef2b4ca4d6430e0dae206a (patch)
tree4a1c84cd687343028d21288ccd70036fa4d4a89a /fs
parentb04accc425d52ca59699290661e0dfd09b0feeeb (diff)
downloadlinux-74aa8c2cc010035a7eef2b4ca4d6430e0dae206a.tar.xz
block: Introduce integrity data ownership flag
A filesystem might supply its own integrity metadata. Introduce a flag that indicates whether the filesystem or the block layer owns the integrity buffer. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
Diffstat (limited to 'fs')
-rw-r--r--fs/bio-integrity.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index 6e28dcdd23a2..19caf7c962ac 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -107,7 +107,8 @@ void bio_integrity_free(struct bio *bio, struct bio_set *bs)
BUG_ON(bip == NULL);
/* A cloned bio doesn't own the integrity metadata */
- if (!bio_flagged(bio, BIO_CLONED) && bip->bip_buf != NULL)
+ if (!bio_flagged(bio, BIO_CLONED) && !bio_flagged(bio, BIO_FS_INTEGRITY)
+ && bip->bip_buf != NULL)
kfree(bip->bip_buf);
mempool_free(bip->bip_vec, bs->bvec_pools[bip->bip_pool]);