]> www.infradead.org Git - users/hch/block.git/commitdiff
block: remove BIP_IP_CHECKSUM
authorChristoph Hellwig <hch@lst.de>
Sun, 6 Jun 2021 12:02:21 +0000 (14:02 +0200)
committerChristoph Hellwig <hch@lst.de>
Mon, 7 Jun 2021 06:12:01 +0000 (08:12 +0200)
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 <hch@lst.de>
block/bio-integrity.c
drivers/scsi/sd.c
include/linux/bio.h
include/linux/blkdev.h

index 8f54d49dc50015f5734a49900e6656cb68ea69b9..117ec20e7e14f8464be1adbcf428320f7d20701a 100644 (file)
@@ -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++) {
index 8bbb9192f3868c26ed582a06c94491e52b0607f5..28995173693358afb94b383cc6e7cf327c7912ed 100644 (file)
@@ -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;
        }
index 3d3acae7ed2e1c4343d50347dd42ede8d5434adf..9f5c0bc49a52ee684323e27a2263946f1d349a63 100644 (file)
@@ -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 */
 };
 
 /*
index d66d0da7252991ab731130d395e18b6bd36710ec..f5f8cd92936920c718be5e9b25740d5c268c5ec0 100644 (file)
@@ -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;