]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/blobdiff - fs/bio.c
block: Add an explicit bio flag for bios that own their bvec
[mirror_ubuntu-zesty-kernel.git] / fs / bio.c
index e545a440d376425e14974f233c564ccd4c77cd08..9238a54b562c9bb0b672f4bd6359871e192c21d8 100644 (file)
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -252,7 +252,7 @@ static void bio_free(struct bio *bio)
        __bio_free(bio);
 
        if (bs) {
-               if (bio_has_allocated_vec(bio))
+               if (bio_flagged(bio, BIO_OWNS_VEC))
                        bvec_free(bs->bvec_pool, bio->bi_io_vec, BIO_POOL_IDX(bio));
 
                /*
@@ -451,6 +451,8 @@ struct bio *bio_alloc_bioset(gfp_t gfp_mask, int nr_iovecs, struct bio_set *bs)
 
                if (unlikely(!bvl))
                        goto err_free;
+
+               bio->bi_flags |= 1 << BIO_OWNS_VEC;
        } else if (nr_iovecs) {
                bvl = bio->bi_inline_vecs;
        }