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++) {
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;
}
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 */
};
/*
#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,
BLK_INTEGRITY_IP_CHECKSUM = 1 << 3,
};
+#ifdef CONFIG_BLK_DEV_INTEGRITY
struct blk_integrity_iter {
void *prot_buf;
void *data_buf;