]> 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>
Thu, 9 Jun 2022 05:48:41 +0000 (07:48 +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

index 32929c89ba8a621c07768c0183ee21383ab5dab1..84ea859c489109b505018ce5cbc07c58f1af93a0 100644 (file)
@@ -257,9 +257,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 d32a3d885c12d559df18a1a6a8f98f04d1297dec..9011aa2350578a29557863777e0577e9d666058e 100644 (file)
@@ -44,6 +44,7 @@
 #include <linux/interrupt.h>
 #include <linux/init.h>
 #include <linux/blkdev.h>
+#include <linux/blk-integrity.h>
 #include <linux/blkpg.h>
 #include <linux/blk-pm.h>
 #include <linux/delay.h>
@@ -744,12 +745,12 @@ static unsigned char sd_setup_protect_cmnd(struct scsi_cmnd *scmd,
                                           unsigned int dix, unsigned int dif)
 {
        struct request *rq = scsi_cmd_to_rq(scmd);
-       struct bio *bio = rq->bio;
+       struct gendisk *disk = rq->q->disk;
        unsigned int prot_op = sd_prot_op(rq_data_dir(rq), dix, dif);
        unsigned int protect = 0;
 
        if (dix) {                              /* DIX Type 0, 1, 2, 3 */
-               if (bio_integrity_flagged(bio, BIP_IP_CHECKSUM))
+               if (blk_get_integrity(disk)->flags & BLK_INTEGRITY_IP_CHECKSUM)
                        scmd->prot_flags |= SCSI_PROT_IP_CHECKSUM;
                scmd->prot_flags |= SCSI_PROT_GUARD_CHECK;
        }
index 2981eebaea90d1e85539dbbef615c67e3e403bd3..b07cc2454f369b9b6d94fc91a69e59bb5869c3d4 100644 (file)
@@ -314,7 +314,6 @@ static inline void bio_next_folio(struct folio_iter *fi, 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 */
 };
 
 /*