From: Christoph Hellwig Date: Sun, 6 Jun 2021 12:02:21 +0000 (+0200) Subject: block: remove BIP_IP_CHECKSUM X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=d16fecefa15ee74f8695f24bb0062e13cef17930;p=users%2Fhch%2Fblock.git block: remove BIP_IP_CHECKSUM Remove the BIP_IP_CHECKSUM flag by replacing the only check for it with a check for BLK_INTEGRITY_IP_CHECKSUM on the gendisk. Signed-off-by: Christoph Hellwig --- diff --git a/block/bio-integrity.c b/block/bio-integrity.c index 8f54d49dc500..117ec20e7e14 100644 --- a/block/bio-integrity.c +++ b/block/bio-integrity.c @@ -259,9 +259,6 @@ bool bio_integrity_prep(struct bio *bio) bip->bip_iter.bi_size = len; bip_set_seed(bip, bio->bi_iter.bi_sector); - if (bi->flags & BLK_INTEGRITY_IP_CHECKSUM) - bip->bip_flags |= BIP_IP_CHECKSUM; - /* Map it */ offset = offset_in_page(buf); for (i = 0 ; i < nr_pages ; i++) { diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index 8bbb9192f386..289951736933 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c @@ -779,12 +779,12 @@ static unsigned int sd_prot_flag_mask(unsigned int prot_op) static unsigned char sd_setup_protect_cmnd(struct scsi_cmnd *scmd, unsigned int dix, unsigned int dif) { - struct bio *bio = scmd->request->bio; + struct blk_integrity *bi = blk_get_integrity(scmd->request->rq_disk); unsigned int prot_op = sd_prot_op(rq_data_dir(scmd->request), dix, dif); unsigned int protect = 0; if (dix) { /* DIX Type 0, 1, 2, 3 */ - if (bio_integrity_flagged(bio, BIP_IP_CHECKSUM)) + if (bi->flags & BLK_INTEGRITY_IP_CHECKSUM) scmd->prot_flags |= SCSI_PROT_IP_CHECKSUM; scmd->prot_flags |= SCSI_PROT_GUARD_CHECK; } diff --git a/include/linux/bio.h b/include/linux/bio.h index 3d3acae7ed2e..9f5c0bc49a52 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h @@ -320,7 +320,6 @@ static inline struct bio_vec *bio_last_bvec_all(struct bio *bio) enum bip_flags { BIP_BLOCK_INTEGRITY = 1 << 0, /* block layer owns integrity data */ BIP_MAPPED_INTEGRITY = 1 << 1, /* ref tag has been remapped */ - BIP_IP_CHECKSUM = 1 << 4, /* IP checksum */ }; /* diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index d66d0da72529..f5f8cd929369 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -1647,8 +1647,6 @@ int kblockd_mod_delayed_work_on(int cpu, struct delayed_work *dwork, unsigned lo #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ MODULE_ALIAS("block-major-" __stringify(major) "-*") -#if defined(CONFIG_BLK_DEV_INTEGRITY) - enum blk_integrity_flags { BLK_INTEGRITY_VERIFY = 1 << 0, BLK_INTEGRITY_GENERATE = 1 << 1, @@ -1656,6 +1654,7 @@ enum blk_integrity_flags { BLK_INTEGRITY_IP_CHECKSUM = 1 << 3, }; +#ifdef CONFIG_BLK_DEV_INTEGRITY struct blk_integrity_iter { void *prot_buf; void *data_buf;