From 80696e5988c6e4716645fac32a748ec0e5b91d4b Mon Sep 17 00:00:00 2001 From: "Martin K. Petersen" Date: Fri, 15 Oct 2010 15:49:20 +0200 Subject: [PATCH] --- yaml --- r: 213070 b: refs/heads/master c: 495d2b3883682fcd1c3dee3a45e38fd00154ae25 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/scsi/sd_dif.c | 11 ++++++----- trunk/include/linux/blk_types.h | 3 +-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 4d8b98178619..b2235ad84176 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e817bf3f68f55e7307c3e9abe5f32d0c05c83988 +refs/heads/master: 495d2b3883682fcd1c3dee3a45e38fd00154ae25 diff --git a/trunk/drivers/scsi/sd_dif.c b/trunk/drivers/scsi/sd_dif.c index 84be62149c6c..0cb39ff21171 100644 --- a/trunk/drivers/scsi/sd_dif.c +++ b/trunk/drivers/scsi/sd_dif.c @@ -375,21 +375,20 @@ int sd_dif_prepare(struct request *rq, sector_t hw_sector, unsigned int sector_s unsigned int i, j; u32 phys, virt; - /* Already remapped? */ - if (rq->cmd_flags & REQ_INTEGRITY) - return 0; - sdkp = rq->bio->bi_bdev->bd_disk->private_data; if (sdkp->protection_type == SD_DIF_TYPE3_PROTECTION) return 0; - rq->cmd_flags |= REQ_INTEGRITY; phys = hw_sector & 0xffffffff; __rq_for_each_bio(bio, rq) { struct bio_vec *iv; + /* Already remapped? */ + if (bio_flagged(bio, BIO_MAPPED_INTEGRITY)) + break; + virt = bio->bi_integrity->bip_sector & 0xffffffff; bip_for_each_vec(iv, bio->bi_integrity, i) { @@ -408,6 +407,8 @@ int sd_dif_prepare(struct request *rq, sector_t hw_sector, unsigned int sector_s kunmap_atomic(sdt, KM_USER0); } + + bio->bi_flags |= BIO_MAPPED_INTEGRITY; } return 0; diff --git a/trunk/include/linux/blk_types.h b/trunk/include/linux/blk_types.h index 10a0c291b55a..d36629620a4f 100644 --- a/trunk/include/linux/blk_types.h +++ b/trunk/include/linux/blk_types.h @@ -97,6 +97,7 @@ struct bio { #define BIO_NULL_MAPPED 9 /* contains invalid user pages */ #define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ #define BIO_QUIET 11 /* Make BIO Quiet */ +#define BIO_MAPPED_INTEGRITY 12/* integrity metadata has been remapped */ #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) /* @@ -148,7 +149,6 @@ enum rq_flag_bits { __REQ_ORDERED_COLOR, /* is before or after barrier */ __REQ_ALLOCED, /* request came from our alloc pool */ __REQ_COPY_USER, /* contains copies of user pages */ - __REQ_INTEGRITY, /* integrity metadata has been remapped */ __REQ_FLUSH, /* request for cache flush */ __REQ_IO_STAT, /* account I/O stat */ __REQ_MIXED_MERGE, /* merge of different types, fail separately */ @@ -190,7 +190,6 @@ enum rq_flag_bits { #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) #define REQ_ALLOCED (1 << __REQ_ALLOCED) #define REQ_COPY_USER (1 << __REQ_COPY_USER) -#define REQ_INTEGRITY (1 << __REQ_INTEGRITY) #define REQ_FLUSH (1 << __REQ_FLUSH) #define REQ_IO_STAT (1 << __REQ_IO_STAT) #define REQ_MIXED_MERGE (1 << __REQ_MIXED_MERGE)