]> www.infradead.org Git - users/hch/block.git/commitdiff
block: remove the BIP_IP_CHECKSUM flag
authorChristoph Hellwig <hch@lst.de>
Mon, 3 Jun 2024 08:54:48 +0000 (10:54 +0200)
committerChristoph Hellwig <hch@lst.de>
Thu, 6 Jun 2024 09:34:18 +0000 (11:34 +0200)
Remove the BIP_IP_CHECKSUM as sd can just look at the per-disk
checksum type instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
block/bio-integrity.c
drivers/scsi/sd.c
include/linux/bio.h

index af7f71d16114de6b127fac3802265e17405d6bbf..c69da65759af89d5bded75eb47f47c459d4d210f 100644 (file)
@@ -488,9 +488,6 @@ bool bio_integrity_prep(struct bio *bio)
        bip->bip_flags |= BIP_BLOCK_INTEGRITY;
        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 && len > 0; i++) {
index b477383ccc3b2ac8a10f1058f09f00c7992fdddd..e21b7df5c31b0d529456f4833767685223d3927b 100644 (file)
@@ -43,7 +43,7 @@
 #include <linux/idr.h>
 #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>
@@ -799,12 +799,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 blk_integrity *bi = &rq->q->integrity;
        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 (bi->flags & BLK_INTEGRITY_IP_CHECKSUM)
                        scmd->prot_flags |= SCSI_PROT_IP_CHECKSUM;
                scmd->prot_flags |= SCSI_PROT_GUARD_CHECK;
        }
index ec5dcf8635ac6640fd622aa55df0b4911d8b4192..3295dd6021659bd642b1115cc4887aebebb4878b 100644 (file)
@@ -324,9 +324,8 @@ 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 */
-       BIP_INTEGRITY_USER      = 1 << 5, /* Integrity payload is user address */
-       BIP_COPY_USER           = 1 << 6, /* Kernel bounce buffer in use */
+       BIP_INTEGRITY_USER      = 1 << 2, /* Integrity payload is user address */
+       BIP_COPY_USER           = 1 << 3, /* Kernel bounce buffer in use */
 };
 
 /*