summaryrefslogtreecommitdiffstats
path: root/fs/bio-integrity.c
diff options
context:
space:
mode:
authorKent Overstreet <koverstreet@google.com>2012-09-04 09:54:22 -0700
committerKent Overstreet <koverstreet@google.com>2013-03-23 14:26:34 -0700
commit29ed7813ce5c4661261aeebddb1b8660e0860223 (patch)
treeaac13437701b575cb1f9ad2aa87a7523af1f7c07 /fs/bio-integrity.c
parenta38352e0ac02dbbd4fa464dc22d1352b5fbd06fd (diff)
downloadlinux-29ed7813ce5c4661261aeebddb1b8660e0860223.tar.gz
linux-29ed7813ce5c4661261aeebddb1b8660e0860223.tar.bz2
linux-29ed7813ce5c4661261aeebddb1b8660e0860223.zip
bio-integrity: Add explicit field for owner of bip_buf
This was the only real user of BIO_CLONED, which didn't have very clear semantics. Convert to its own flag so we can get rid of BIO_CLONED. Signed-off-by: Kent Overstreet <koverstreet@google.com> CC: Jens Axboe <axboe@kernel.dk> CC: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'fs/bio-integrity.c')
-rw-r--r--fs/bio-integrity.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
index ca7b02dbf09d..8fb42916d8a2 100644
--- a/fs/bio-integrity.c
+++ b/fs/bio-integrity.c
@@ -97,9 +97,7 @@ void bio_integrity_free(struct bio *bio)
struct bio_integrity_payload *bip = bio->bi_integrity;
struct bio_set *bs = bio->bi_pool;
- /* A cloned bio doesn't own the integrity metadata */
- if (!bio_flagged(bio, BIO_CLONED) && !bio_flagged(bio, BIO_FS_INTEGRITY)
- && bip->bip_buf != NULL)
+ if (bip->bip_owns_buf)
kfree(bip->bip_buf);
if (bs) {
@@ -386,6 +384,7 @@ int bio_integrity_prep(struct bio *bio)
return -EIO;
}
+ bip->bip_owns_buf = 1;
bip->bip_buf = buf;
bip->bip_size = len;
bip->bip_sector = bio->bi_sector;