All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Martin K. Petersen" <martin.petersen@oracle.com>
To: linux-scsi@vger.kernel.org
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Subject: [PATCH 04/14] block: Remove bip_buf
Date: Fri, 25 Jul 2014 16:34:19 -0400	[thread overview]
Message-ID: <1406320469-29352-5-git-send-email-martin.petersen@oracle.com> (raw)
In-Reply-To: <1406320469-29352-1-git-send-email-martin.petersen@oracle.com>

bip_buf is not really needed so we can remove it.

Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Sagi Grimberg <sagig@mellanox.com>
---
 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_iter	bip_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


  parent reply	other threads:[~2014-07-25 20:33 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 20:34 Block/SCSI data integrity update v2 Martin K. Petersen
2014-07-25 20:34 ` [PATCH 01/14] block: Get rid of bdev_integrity_enabled() Martin K. Petersen
2014-07-25 20:34 ` [PATCH 02/14] block: Replace bi_integrity with bi_special Martin K. Petersen
2014-07-26 15:24   ` Christoph Hellwig
2014-08-06 13:15   ` Sagi Grimberg
2014-07-25 20:34 ` [PATCH 03/14] block: Remove integrity tagging functions Martin K. Petersen
2014-08-06 13:16   ` Sagi Grimberg
2014-07-25 20:34 ` Martin K. Petersen [this message]
2014-07-25 20:34 ` [PATCH 05/14] block: Deprecate the use of the term sector in the context of block integrity Martin K. Petersen
2014-07-26 15:25   ` Christoph Hellwig
2014-08-06 13:32   ` Sagi Grimberg
2014-08-06 13:43     ` Sagi Grimberg
2014-07-25 20:34 ` [PATCH 06/14] block: Make protection interval calculation generic Martin K. Petersen
2014-07-26 15:26   ` Christoph Hellwig
2014-08-06 15:43   ` Sagi Grimberg
2014-07-25 20:34 ` [PATCH 07/14] block: Clean up the code used to generate and verify integrity metadata Martin K. Petersen
2014-07-25 20:34 ` [PATCH 08/14] block: Add prefix to block integrity profile flags Martin K. Petersen
2014-07-25 20:34 ` [PATCH 09/14] block: Add a disk flag to block integrity profile Martin K. Petersen
2014-07-25 20:34 ` [PATCH 10/14] block: Relocate bio integrity flags Martin K. Petersen
2014-07-25 20:34 ` [PATCH 11/14] block: Integrity checksum flag Martin K. Petersen
2014-08-06 15:43   ` Sagi Grimberg
2014-07-25 20:34 ` [PATCH 12/14] block: Don't merge requests if integrity flags differ Martin K. Petersen
2014-07-25 20:34 ` [PATCH 13/14] block: Add T10 Protection Information functions Martin K. Petersen
2014-07-25 20:34 ` [PATCH 14/14] sd: Honor block layer integrity handling flags Martin K. Petersen
2014-07-26 16:23 ` Block/SCSI data integrity update v2 Christoph Hellwig
2014-07-26 16:33   ` Martin K. Petersen
2014-07-29 12:29 ` Christoph Hellwig
  -- strict thread matches above, loose matches on Subject: below --
2014-08-28 19:31 Block/SCSI data integrity update v3 Martin K. Petersen
2014-08-28 19:31 ` [PATCH 04/14] block: Remove bip_buf Martin K. Petersen
2014-05-29  3:28 Data integrity update Martin K. Petersen
2014-05-29  3:28 ` [PATCH 04/14] block: Remove bip_buf Martin K. Petersen
2014-06-11 16:35   ` Christoph Hellwig
2014-07-03  9:21     ` Sagi Grimberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1406320469-29352-5-git-send-email-martin.petersen@oracle.com \
    --to=martin.petersen@oracle.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.