[PATCH 04/14] block: Remove bip_buf
bip_buf is not really needed so we can remove it. Signed-off-by: Martin K. Petersen Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg --- block/bio-integrity.c | 10 ++ include/linux/bio.h | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 9be2431475e5..e4a015f661fc 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -101,7 +101,8 @@ void bio_integrity_free(struct bio *bio) struct bio_set *bs = bio->bi_pool; if (bip->bip_owns_buf) - kfree(bip->bip_buf); + kfree(page_address(bip->bip_vec->bv_page) + + bip->bip_vec->bv_offset); if (bs) { if (bip->bip_slab != BIO_POOL_NONE) @@ -219,14 +220,16 @@ static int bio_integrity_generate_verify(struct bio *bio, int operate) struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev); struct blk_integrity_exchg bix; struct bio_vec *bv; + struct bio_integrity_payload *bip = bio_integrity(bio); sector_t sector; unsigned int sectors, ret = 0, i; - void *prot_buf = bio_integrity(bio)->bip_buf; + void *prot_buf = page_address(bip->bip_vec->bv_page) + + bip->bip_vec->bv_offset; if (operate) sector = bio->bi_iter.bi_sector; else - sector = bio_integrity(bio)->bip_iter.bi_sector; + sector = bip->bip_iter.bi_sector; bix.disk_name = bio->bi_bdev->bd_disk->disk_name; bix.sector_size = bi->sector_size; @@ -321,7 +324,6 @@ int bio_integrity_prep(struct bio *bio) } bip->bip_owns_buf = 1; - bip->bip_buf = buf; bip->bip_iter.bi_size = len; bip->bip_iter.bi_sector = bio->bi_iter.bi_sector; diff --git a/include/linux/bio.h b/include/linux/bio.h index 63a0e53e238c..448d8c052cb7 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -310,9 +310,6 @@ struct bio_integrity_payload { struct bvec_iterbip_iter; - /* kill - should just use bip_vec */ - void*bip_buf; /* generated integrity data */ - bio_end_io_t*bip_end_io;/* saved I/O completion fn */ unsigned short bip_slab; /* slab the bip came from */ -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 04/14] block: Remove bip_buf
bip_buf is not really needed so we can remove it. Signed-off-by: Martin K. Petersen Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg --- block/bio-integrity.c | 10 ++ include/linux/bio.h | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 2c4bbc0aaa93..cea93a9553d6 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -99,7 +99,8 @@ void bio_integrity_free(struct bio *bio) struct bio_set *bs = bio->bi_pool; if (bip->bip_owns_buf) - kfree(bip->bip_buf); + kfree(page_address(bip->bip_vec->bv_page) + + bip->bip_vec->bv_offset); if (bs) { if (bip->bip_slab != BIO_POOL_NONE) @@ -225,14 +226,16 @@ static int bio_integrity_generate_verify(struct bio *bio, int operate) struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev); struct blk_integrity_exchg bix; struct bio_vec *bv; + struct bio_integrity_payload *bip = bio_integrity(bio); sector_t sector; unsigned int sectors, ret = 0, i; - void *prot_buf = bio_integrity(bio)->bip_buf; + void *prot_buf = page_address(bip->bip_vec->bv_page) + + bip->bip_vec->bv_offset; if (operate) sector = bio->bi_iter.bi_sector; else - sector = bio_integrity(bio)->bip_iter.bi_sector; + sector = bip->bip_iter.bi_sector; bix.disk_name = bio->bi_bdev->bd_disk->disk_name; bix.sector_size = bi->sector_size; @@ -327,7 +330,6 @@ int bio_integrity_prep(struct bio *bio) } bip->bip_owns_buf = 1; - bip->bip_buf = buf; bip->bip_iter.bi_size = len; bip->bip_iter.bi_sector = bio->bi_iter.bi_sector; diff --git a/include/linux/bio.h b/include/linux/bio.h index f8b09d7020ef..38bcec55c4c6 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -310,9 +310,6 @@ struct bio_integrity_payload { struct bvec_iterbip_iter; - /* kill - should just use bip_vec */ - void*bip_buf; /* generated integrity data */ - bio_end_io_t*bip_end_io;/* saved I/O completion fn */ unsigned short bip_slab; /* slab the bip came from */ -- 1.9.3 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 04/14] block: Remove bip_buf
On 6/11/2014 7:35 PM, Christoph Hellwig wrote: On Wed, May 28, 2014 at 11:28:38PM -0400, Martin K. Petersen wrote: bip_buf is not really needed so we can remove it. Signed-off-by: Martin K. Petersen Looks good, Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH 04/14] block: Remove bip_buf
On Wed, May 28, 2014 at 11:28:38PM -0400, Martin K. Petersen wrote: > bip_buf is not really needed so we can remove it. > > Signed-off-by: Martin K. Petersen Looks good, Reviewed-by: Christoph Hellwig -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH 04/14] block: Remove bip_buf
bip_buf is not really needed so we can remove it. Signed-off-by: Martin K. Petersen --- block/bio-integrity.c | 10 ++ include/linux/bio.h | 3 --- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/block/bio-integrity.c b/block/bio-integrity.c index f59cdc2e0e63..e06b3c807eef 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -99,7 +99,8 @@ void bio_integrity_free(struct bio *bio) struct bio_set *bs = bio->bi_pool; if (bip->bip_owns_buf) - kfree(bip->bip_buf); + kfree(page_address(bip->bip_vec->bv_page) + + bip->bip_vec->bv_offset); if (bs) { if (bip->bip_slab != BIO_POOL_NONE) @@ -225,14 +226,16 @@ static int bio_integrity_generate_verify(struct bio *bio, int operate) struct blk_integrity *bi = bdev_get_integrity(bio->bi_bdev); struct blk_integrity_exchg bix; struct bio_vec *bv; + struct bio_integrity_payload *bip = bio_integrity(bio); sector_t sector; unsigned int sectors, ret = 0, i; - void *prot_buf = bio_integrity(bio)->bip_buf; + void *prot_buf = page_address(bip->bip_vec->bv_page) + + bip->bip_vec->bv_offset; if (operate) sector = bio->bi_iter.bi_sector; else - sector = bio_integrity(bio)->bip_iter.bi_sector; + sector = bip->bip_iter.bi_sector; bix.disk_name = bio->bi_bdev->bd_disk->disk_name; bix.sector_size = bi->sector_size; @@ -327,7 +330,6 @@ int bio_integrity_prep(struct bio *bio) } bip->bip_owns_buf = 1; - bip->bip_buf = buf; bip->bip_iter.bi_size = len; bip->bip_iter.bi_sector = bio->bi_iter.bi_sector; diff --git a/include/linux/bio.h b/include/linux/bio.h index f7fa470c043e..5d9c7680280b 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -292,9 +292,6 @@ struct bio_integrity_payload { struct bvec_iterbip_iter; - /* kill - should just use bip_vec */ - void*bip_buf; /* generated integrity data */ - bio_end_io_t*bip_end_io;/* saved I/O completion fn */ unsigned short bip_slab; /* slab the bip came from */ -- 1.9.0 -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html